Automattic\WooCommerce\Admin\API
Notes::get_items()
Get all notes.
Метод класса: Notes{}
Хуков нет.
Возвращает
WP_REST_Response
.
Использование
$Notes = new Notes(); $Notes->get_items( $request );
- $request(WP_REST_Request) (обязательный)
- Request data.
Код Notes::get_items() Notes::get items WC 9.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; }