Make WordPress Core

Changeset 61614

Timestamp:
02/11/2026 09:09:12 PM (3 weeks ago)
Author:
audrasjb
Message:

Site Health: Allow direct linking to site health check result.

This changeset does the following changes:

  • Add an ID to each accordion button
  • Update the URL hash each time an accordion button is clicked
  • On page load, open the related accordion when provided

This way, people can use the URL of the page to share a direct link to the site health info section they want.

Props sippis, kabir93, audrasjb, saratheonline, pratiklondhe, vgnavada, SirLouen, nikunj8866, pmbaldha, sajjad67, huzaifaalmesbah, westonruter.
Fixes #62846.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/site-health.js

    r57231 r61614  
    4545        var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) );
    4646
     47
     48
     49
     50
    4751        if ( isExpanded ) {
    4852            $( this ).attr( 'aria-expanded', 'false' );
     
    5155            $( this ).attr( 'aria-expanded', 'true' );
    5256            $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', false );
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
    5371        }
    5472    } );
  • trunk/src/wp-admin/site-health-info.php

    r59859 r61614  
    7474            ?>
    7575            <h3 class="health-check-accordion-heading">
    76                 <button aria-expanded="false" class="health-check-accordion-trigger" aria-controls="health-check-accordion-block-<?php echo esc_attr( $section ); ?>" type="button">
     76                <button aria-expanded="false" class="health-check-accordion-trigger" aria-controls="health-check-accordion-block-<?php echo esc_attr( $section ); ?>" type="button">
    7777                    <span class="title">
    7878                        <?php echo esc_html( $details['label'] ); ?>
Note: See TracChangeset for help on using the changeset viewer.