Tools and status require rest API init
This commit is contained in:
parent
0f731d9c3f
commit
c47a6b9172
|
@ -31,6 +31,15 @@ class WC_Admin_Status {
|
|||
* Handles output of tools.
|
||||
*/
|
||||
public static function status_tools() {
|
||||
// This screen requires classes from the REST API.
|
||||
if ( ! did_action( 'rest_api_init' ) ) {
|
||||
WC()->api->rest_api_includes();
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WC_REST_System_Status_Tools_Controller', false ) ) {
|
||||
wp_die( 'Cannot load the REST API to access WC_REST_System_Status_Tools_Controller.' );
|
||||
}
|
||||
|
||||
$tools = self::get_tools();
|
||||
|
||||
if ( ! empty( $_GET['action'] ) && ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_REQUEST['_wpnonce'] ), 'debug_action' ) ) { // WPCS: input var ok, sanitization ok.
|
||||
|
|
|
@ -9,6 +9,11 @@ defined( 'ABSPATH' ) || exit;
|
|||
|
||||
global $wpdb;
|
||||
|
||||
// This screen requires classes from the REST API.
|
||||
if ( ! did_action( 'rest_api_init' ) ) {
|
||||
WC()->api->rest_api_includes();
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WC_REST_System_Status_Controller', false ) ) {
|
||||
wp_die( 'Cannot load the REST API to access WC_REST_System_Status_Controller.' );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue