Automattic\WooCommerce\Admin\API
Notes::get_items
Get all notes.
Method of the class: Notes{}
No Hooks.
Returns
WP_REST_Response.
Usage
$Notes = new Notes(); $Notes->get_items( $request );
- $request(WP_REST_Request) (required)
- Request data.
Notes::get_items() Notes::get items code WC 10.8.1
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;
}