Make WordPress Core

Opened 4 months ago

Last modified 10 days ago

#47225 new enhancement

Add new actions to Site Health navigation

Reported by: ramiy Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Site Health Keywords: site-health has-screenshots has-patch
Focuses: administration Cc:


The attached patch adds two new actions to allow developers to add new navigation tabs to the Site Health screens.

Attachments (2)

47225.png (18.9 KB) - added by ramiy 4 months ago.
47225.patch (2.0 KB) - added by ramiy 4 months ago.

Download all attachments as: .zip

Change History (10)

4 months ago

4 months ago

#1 @ramiy
4 months ago

  • Component changed from Script Loader to Administration
  • Keywords site-health has-screenshots has-patch added

#2 @desrosj
4 months ago

  • Milestone changed from Awaiting Review to 5.3

#3 @ramiy
3 months ago

@desrosj Any updates?

#4 @desrosj
3 months ago

  • Component changed from Administration to Site Health

Moving Site Health tickets into their lovely new home, the Site Health component.

#5 @Clorith
3 months ago

Quick update for anyone following this. We're investigating how to solve the problem of tabs when it comes to mobile and IE11 compatibility over on the plugin side of things (so that we can test and iterate in the plugin before any core implementation takes place). The relevant GitHub issue is available at https://github.com/WordPress/health-check/issues/344

This ticket was mentioned in Slack in #core-php by ramiy. View the logs.

3 months ago

#7 @ramiy
3 months ago

There are several approaches to allow developers to add new navigation tabs.

  1. Using Actions - With actions developers can inject custom HTML linking to their settings screens.
  1. Using Filters - We can replace the hardcoded HTML with an array. Developers can filter the array to add new tabs linking to their settings screens.

With actions:

function custom_site_health_tab() {
    <a href="<?php echo esc_url( admin_url( 'some-screen' ) ); ?>" class="health-check-tab">
      <?php _e( 'Label' ); ?>
add_action( 'site_health_after_tabs', 'custom_site_health_tab' );

With filters:

function custom_site_health_navigation_tab( $tabs ) {
  $tabs[] = array(
    'id'    => 'some-unique-id',
    'label' => __( 'Label' ),
    'url'   => admin_url( 'some-screen' )
  return $tabs;
add_filter( 'site_health_navigation_tabs', 'custom_site_health_navigation_tab' );

#8 @Clorith
10 days ago

  • Milestone changed from 5.3 to Future Release

Although I'd love to do this, we've had our focus on the grading and test filters for 5.3, I'm moving this to Future release, with the intention of tackling this for version 5.4

Note: See TracTickets for help on using tickets.