Skip to content

Instantly share code, notes, and snippets.

@jocastaneda
Created June 23, 2018 22:28
Show Gist options
  • Save jocastaneda/8eea236ec2ab1e6182057d78c611cd7e to your computer and use it in GitHub Desktop.
Save jocastaneda/8eea236ec2ab1e6182057d78c611cd7e to your computer and use it in GitHub Desktop.
diff --git a/src/includes/class-healthcheck.php b/src/includes/class-healthcheck.php
index ff3f4ad..31204fb 100644
--- a/src/includes/class-healthcheck.php
+++ b/src/includes/class-healthcheck.php
@@ -308,13 +308,16 @@ class HealthCheck {
</h1>
<?php
- $tabs = array(
+ /*
+ * Filters the pages being output.
+ */
+ $tabs = apply_filters( 'health_check_pages', array(
'health-check' => esc_html_x( 'Health Check', 'Menu, Section and Page Title', 'health-check' ),
'debug' => esc_html__( 'Debug Information', 'health-check' ),
'troubleshoot' => esc_html__( 'Troubleshooting', 'health-check' ),
'phpinfo' => esc_html__( 'PHP Information', 'health-check' ),
'tools' => esc_html__( 'Tools', 'health-check' ),
- );
+ ) );
$current_tab = ( isset( $_GET['tab'] ) ? $_GET['tab'] : 'health-check' );
?>
@@ -337,6 +340,8 @@ class HealthCheck {
</h2>
<?php
+ // Fires before a page is output
+ do_action( "health_check_before_{$current_tab}_output" );
switch ( $current_tab ) {
case 'debug':
include_once( HEALTH_CHECK_PLUGIN_DIRECTORY . '/pages/debug-data.php' );
@@ -354,6 +359,11 @@ class HealthCheck {
default:
include_once( HEALTH_CHECK_PLUGIN_DIRECTORY . '/pages/health-check.php' );
}
+ // Fires after the switch statement of tabs.
+ do_action( 'health_check_tab_switch', $current_tab );
+
+ // Fires after the tab content has been
+ do_action( "health_check_after_{$current_tab}_output" );
?>
</div>
<?php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment