Yoast\WP\SEO\General\User_Interface

Opt_In_Route::register_routespublicYoast 1.0

Registers routes with WordPress.

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

Хуков нет.

Возвращает

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

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

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

Код Opt_In_Route::register_routes() Yoast 26.9

public function register_routes() {
	$opt_in_seen_route_args = [
		'methods'             => 'POST',
		'callback'            => [ $this, 'set_opt_in_seen' ],
		'permission_callback' => [ $this, 'can_see_opt_in' ],
		'args'                => [
			'key' => [
				'required'          => true,
				'type'              => 'string',
				'sanitize_callback' => 'sanitize_text_field',
				'validate_callback' => [ $this, 'validate_key' ],
			],
		],
	];

	\register_rest_route( Main::API_V1_NAMESPACE, self::SEEN_ROUTE, $opt_in_seen_route_args );
}