WP_REST_Controller::get_items( WP_REST_Request $request ): WP_REST_Response|WP_Error

In this article

Retrieves a collection of items.

Parameters

$requestWP_REST_Requestrequired
Full details about the request.

Return

WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.

Source

public function get_items( $request ) {
	return new WP_Error(
		'invalid-method',
		/* translators: %s: Method name. */
		sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ),
		array( 'status' => 405 )
	);
}

Changelog

VersionDescription
4.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.