WPSEO_Endpoint_File_Size::register()publicYoast 1.0

Registers the routes for the endpoints.

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

Хуков нет.

Возвращает

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

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

$WPSEO_Endpoint_File_Size = new WPSEO_Endpoint_File_Size();
$WPSEO_Endpoint_File_Size->register();

Код WPSEO_Endpoint_File_Size::register() Yoast 22.4

public function register() {
	$route_args = [
		'methods'             => 'GET',
		'args'                => [
			'url' => [
				'required'    => true,
				'type'        => 'string',
				'description' => 'The url to retrieve',
			],
		],
		'callback'            => [
			$this->service,
			'get',
		],
		'permission_callback' => [
			$this,
			'can_retrieve_data',
		],
	];
	register_rest_route( self::REST_NAMESPACE, self::ENDPOINT_SINGULAR, $route_args );
}