woocommerce/api/admin-notes/delete-all-notes.php

19 lines
491 B
PHP
Raw Normal View History

2021-03-01 03:57:53 +00:00
<?php
2021-03-03 06:27:47 +00:00
register_woocommerce_admin_test_helper_rest_route(
'/admin-notes/delete-all-notes/v1',
'admin_notes_delete_all_notes'
);
2021-03-01 03:57:53 +00:00
function admin_notes_delete_all_notes() {
global $wpdb;
$deleted_note_count = $wpdb->query( "DELETE FROM {$wpdb->prefix}wc_admin_notes" );
$deleted_action_count = $wpdb->query( "DELETE FROM {$wpdb->prefix}wc_admin_note_actions" );
return array(
'deleted_note_count' => $deleted_note_count,
'deleted_action_count' => $deleted_action_count,
);
}