Automattic\WooCommerce\Admin\API

Notes::get_items()publicWC 1.0

Get all notes.

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

Хуков нет.

Возвращает

WP_REST_Response.

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

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

Код Notes::get_items() WC 6.9.4

public function get_items( $request ) {
	$query_args = $this->prepare_objects_query( $request );

	$notes = NotesRepository::get_notes( 'edit', $query_args );

	$data = array();
	foreach ( (array) $notes as $note_obj ) {
		$note   = $this->prepare_item_for_response( $note_obj, $request );
		$note   = $this->prepare_response_for_collection( $note );
		$data[] = $note;
	}

	$response = rest_ensure_response( $data );
	$response->header( 'X-WP-Total', count( $data ) );

	return $response;
}