diff --git a/src/js/_enqueues/admin/site-health.js b/src/js/_enqueues/admin/site-health.js index 416295df69b17..6c71234170ced 100644 --- a/src/js/_enqueues/admin/site-health.js +++ b/src/js/_enqueues/admin/site-health.js @@ -44,6 +44,8 @@ jQuery( function( $ ) { $( '.health-check-accordion' ).on( 'click', '.health-check-accordion-trigger', function() { var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) ); + window.location.hash = $( this ).attr( 'id' ); + if ( isExpanded ) { $( this ).attr( 'aria-expanded', 'false' ); $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', true ); @@ -53,8 +55,19 @@ jQuery( function( $ ) { } } ); - // Site Health test handling. + // Get hash from query string and open the related accordion. + $( window ).on( 'load', function() { + var hash = window.location.hash; + if ( hash ) { + var requestedPanel = $( hash ); + if ( requestedPanel.length ) { + $( requestedPanel ).attr( 'aria-expanded', 'true' ); + $( '#' + requestedPanel.attr( 'aria-controls' ) ).attr( 'hidden', false ); + } + } + } ); + // Site Health test handling. $( '.site-health-view-passed' ).on( 'click', function() { var goodIssuesWrapper = $( '#health-check-issues-good' ); diff --git a/src/wp-admin/site-health-info.php b/src/wp-admin/site-health-info.php index 2f23f8306854d..58930948a7e09 100644 --- a/src/wp-admin/site-health-info.php +++ b/src/wp-admin/site-health-info.php @@ -73,7 +73,7 @@ ?>

-