Moved action call

This commit is contained in:
Jesse Pearson 2018-09-05 07:34:52 -04:00
parent 2faadce24f
commit fe7817163c
1 changed files with 16 additions and 16 deletions

View File

@ -39,6 +39,22 @@ class WC_Admin_Status {
if ( array_key_exists( $action, $tools ) ) {
$response = $tools_controller->execute_tool( $action );
$tool = $tools[ $action ];
$tool = array(
'id' => $action,
'name' => $tool['name'],
'action' => $tool['button'],
'description' => $tool['desc'],
);
$tool = array_merge( $tool, $response );
/**
* Fires after a WooCommerce system status tool has been executed.
*
* @param array $tool Details about the tool that has been executed.
*/
do_action( 'woocommerce_system_status_tool_executed', $tool );
} else {
$response = array(
'success' => false,
@ -51,22 +67,6 @@ class WC_Admin_Status {
} else {
echo '<div class="error inline"><p>' . esc_html( $response['message'] ) . '</p></div>';
}
$tool = $tools[ $action ];
$tool = array(
'id' => $action,
'name' => $tool['name'],
'action' => $tool['button'],
'description' => $tool['desc'],
);
$tool = array_merge( $tool, $response );
/**
* Fires after a WooCommerce system status tool has been executed.
*
* @param array $tool Details about the tool that has been executed.
*/
do_action( 'woocommerce_system_status_tool_executed', $tool );
}
// Display message if settings settings have been saved.