Yoast\WP\SEO\AI\Consent\User_Interface

Consent_Route::register_routespublicYoast 1.0

Registers routes with WordPress.

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

Хуков нет.

Возвращает

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

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

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

Код Consent_Route::register_routes() Yoast 28.3

public function register_routes() {
	\register_rest_route(
		self::ROUTE_NAMESPACE,
		self::ROUTE_PREFIX,
		[
			'methods'             => 'POST',
			'args'                => [
				'consent' => [
					'required'    => true,
					'type'        => 'boolean',
					'description' => 'Whether the consent to use AI-based services has been given by the user.',
				],
			],
			'callback'            => [ $this, 'consent' ],
			'permission_callback' => [ $this, 'check_permissions' ],
		],
	);
}