Automattic\WooCommerce\Admin\API

Notes::delete_all_items()publicWC 1.0

Delete all notes.

Метод класса: Notes{}

Хуков нет.

Возвращает

WP_REST_Request|WP_Error.

Использование

$Notes = new Notes();
$Notes->delete_all_items( $request );
$request(WP_REST_Request) (обязательный)
Request object.

Код Notes::delete_all_items() WC 8.7.0

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