WP_REST_Settings_Controller::register_routes()publicWP 4.7.0

Registers the routes for the site's settings.

Метод класса: WP_REST_Settings_Controller{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$WP_REST_Settings_Controller = new WP_REST_Settings_Controller();
$WP_REST_Settings_Controller->register_routes();

Заметки

Список изменений

С версии 4.7.0 Введена.

Код WP_REST_Settings_Controller::register_routes() WP 6.6.2

public function register_routes() {

	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base,
		array(
			array(
				'methods'             => WP_REST_Server::READABLE,
				'callback'            => array( $this, 'get_item' ),
				'args'                => array(),
				'permission_callback' => array( $this, 'get_item_permissions_check' ),
			),
			array(
				'methods'             => WP_REST_Server::EDITABLE,
				'callback'            => array( $this, 'update_item' ),
				'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
				'permission_callback' => array( $this, 'get_item_permissions_check' ),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);
}