Merge pull request #10874 from allendav/master

Add filtering for system status page tabs and actions too
This commit is contained in:
Claudio Sanches 2016-05-09 18:37:32 -03:00
commit 857471843a
1 changed files with 7 additions and 3 deletions

View File

@ -13,7 +13,7 @@ $tabs = array(
'tools' => __( 'Tools', 'woocommerce' ),
'logs' => __( 'Logs', 'woocommerce' ),
);
$tabs = apply_filters( 'woocommerce_admin_status_tabs', $tabs );
?>
<div class="wrap woocommerce">
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
@ -25,7 +25,7 @@ $tabs = array(
}
?>
</nav>
<h1 class="screen-reader-text"><?php echo esc_html( $tabs[ $current_tab ] ); ?></h1>
<h1 class="screen-reader-text"><?php echo esc_html( $tabs[ $current_tab ] ); ?></h1>
<?php
switch ( $current_tab ) {
case "tools" :
@ -35,7 +35,11 @@ $tabs = array(
WC_Admin_Status::status_logs();
break;
default :
WC_Admin_Status::status_report();
if ( array_key_exists( $current_tab, $tabs ) && has_action( 'woocommerce_admin_status_content_' . $current_tab ) ) {
do_action( 'woocommerce_admin_status_content_' . $current_tab );
} else {
WC_Admin_Status::status_report();
}
break;
}
?>