这是我的代码:
function woo_delete_customer(){
$customer = new WC_Customer(get_current_user_id());
$val = $customer -> delete();
if($val){
$customer -> save();
$data = [];
$data[\'Status\'] = \'Customer was successfully deleted\';
return new WP_REST_Response( $data, 200 );
}
else{
new WP_Error(
\'woo_deleting_problems\',
\'Can\\\'t delete customer!\',
array(
\'status\' => 403,
)
);
}
}
这是我的日志:
2019-11-16T05:29:23+00:00 CRITICAL Call to undefined function wp_delete_user() in /home/test.com/public_html/wp-content/plugins/woocommerce/includes/data-stores/class-wc-customer-data-store.php on line 235
请帮帮我!((