W3cubDocs

/WordPress

WP_REST_Navigation_Fallback_Controller::register_routes()

Registers the controllers routes.

Source

public function register_routes() {

	// Lists a single nav item based on the given id or slug.
	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base,
		array(
			array(
				'methods'             => WP_REST_Server::READABLE,
				'callback'            => array( $this, 'get_item' ),
				'permission_callback' => array( $this, 'get_item_permissions_check' ),
				'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::READABLE ),
			),
			'schema' => array( $this, 'get_item_schema' ),
		)
	);
}

Changelog

Version Description
6.3.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_navigation_fallback_controller/register_routes