Automattic\WooCommerce\Admin\API
Notes::delete_all_items
Delete all notes.
Method of the class: Notes{}
No Hooks.
Returns
WP_REST_Request|WP_Error.
Usage
$Notes = new Notes(); $Notes->delete_all_items( $request );
- $request(WP_REST_Request) (required)
- Request object.
Notes::delete_all_items() Notes::delete all items code WC 10.4.3
public function delete_all_items( $request ) {
$args = array();
if ( isset( $request['status'] ) ) {
$args['status'] = $request['status'];
}
$notes = NotesRepository::delete_all_notes( $args );
$data = array();
foreach ( (array) $notes as $note_obj ) {
$data[] = $this->prepare_note_data_for_response( $note_obj, $request );
}
$response = rest_ensure_response( $data );
$response->header( 'X-WP-Total', NotesRepository::get_notes_count( array( 'info', 'warning' ), array() ) );
return $response;
}