WordPress.org

Make WordPress Core

Opened 19 months ago

Last modified 12 months 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:

Description

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 19 months ago.
47225.patch (2.0 KB) - added by ramiy 19 months ago.

Download all attachments as: .zip

Change History (11)

@ramiy
19 months ago

@ramiy
19 months ago

#1 @ramiy
19 months ago

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

#2 @desrosj
19 months ago

  • Milestone changed from Awaiting Review to 5.3

#3 @ramiy
18 months ago

@desrosj Any updates?

#4 @desrosj
18 months ago

  • Component changed from Administration to Site Health

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

#5 @Clorith
18 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.


18 months ago

#7 @ramiy
18 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' ); ?>
    </a>
  <?php
}
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
15 months 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

#9 @ramiy
12 months ago

@Clorith @desrosj Can you change the ticket Milestone to 5.4 ?

Note: See TracTickets for help on using tickets.