$tabs The tabs on the Site Health page. * * @return array */ function add_tools_tab( array $tabs ): array { return array_merge( $tabs, array( 'troubleshooting' => \esc_html__( 'Troubleshooting', 'troubleshooting' ), ) ); } /** * Adds the content for the Tools tab on the Site Health page. * * @param string $tab The current tab being viewed. * * @return void */ function add_tools_tab_content( string $tab ): void { if ( 'troubleshooting' !== $tab ) { return; } include_once __DIR__ . '/templates/troubleshooting.php'; } /** * Register hooks and filters for the Site Health screen. * * @return void */ function register_actions(): void { if ( ! \is_admin() || ! \current_user_can( 'manage_options' ) ) { return; } \add_filter( 'site_health_navigation_tabs', __NAMESPACE__ . '\add_tools_tab' ); \add_action( 'site_health_tab_content', __NAMESPACE__ . '\add_tools_tab_content' ); } \add_action( 'load-site-health.php', __NAMESPACE__ . '\register_actions' ); // Instantiate the Troubleshooting wrapper class. Troubleshoot::get_instance();