From 2faadce24f29d21eabc3d9a317b05800f989f5c5 Mon Sep 17 00:00:00 2001 From: Jesse Pearson Date: Tue, 4 Sep 2018 09:33:16 -0400 Subject: [PATCH] Add action for when system tools are run --- includes/admin/class-wc-admin-status.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/includes/admin/class-wc-admin-status.php b/includes/admin/class-wc-admin-status.php index 5be05ea25f9..a2570ab7eac 100644 --- a/includes/admin/class-wc-admin-status.php +++ b/includes/admin/class-wc-admin-status.php @@ -51,6 +51,22 @@ class WC_Admin_Status { } else { echo '

' . esc_html( $response['message'] ) . '

'; } + + $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.