Yoast\WP\SEO\Introductions\User_Interface

Introductions_Seen_Route::register_routes()publicYoast 1.0

Registers routes with WordPress.

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

Хуков нет.

Возвращает

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

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

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

Код Introductions_Seen_Route::register_routes() Yoast 24.4

public function register_routes() {
	\register_rest_route(
		Main::API_V1_NAMESPACE,
		self::ROUTE_PREFIX,
		[
			[
				'methods'             => 'POST',
				'callback'            => [ $this, 'set_introduction_seen' ],
				'permission_callback' => [ $this, 'permission_edit_posts' ],
				'args'                => [
					'introduction_id' => [
						'required'          => true,
						'type'              => 'string',
						'sanitize_callback' => 'sanitize_text_field',
					],
					'is_seen'         => [
						'required'          => false,
						'type'              => 'bool',
						'default'           => true,
						'sanitize_callback' => 'rest_sanitize_boolean',
					],
				],
			],
		]
	);
}