WC_AJAX::delete_order_note()
Delete order note via ajax.
Method of the class: WC_AJAX{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = WC_AJAX::delete_order_note();
WC_AJAX::delete_order_note() WC AJAX::delete order note code WC 9.2.3
public static function delete_order_note() { check_ajax_referer( 'delete-order-note', 'security' ); if ( ! current_user_can( 'edit_shop_orders' ) || ! isset( $_POST['note_id'] ) ) { wp_die( -1 ); } $note_id = (int) $_POST['note_id']; if ( $note_id > 0 ) { wc_delete_order_note( $note_id ); } wp_die(); }