WC_AJAX::delete_order_note()public staticWC 1.0

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() code WC 8.6.1

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();
}