Yoast\WP\SEO\Routes

Indexables_Page_Route::register_routes()publicYoast 1.0

Registers routes with WordPress.

{} Это метод класса: Indexables_Page_Route{}

Хуков нет.

Возвращает

null. Ничего.

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

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

Код Indexables_Page_Route::register_routes() Yoast 19.10

public function register_routes() {
	$setup_info_route = [
		[
			'methods'             => 'GET',
			'callback'            => [ $this, 'get_setup_info' ],
			'permission_callback' => [ $this, 'permission_edit_others_posts' ],
		],
	];

	\register_rest_route( Main::API_V1_NAMESPACE, self::SETUP_INFO, $setup_info_route );

	$least_readability_route = [
		[
			'methods'             => 'GET',
			'callback'            => [ $this, 'get_least_readable' ],
			'permission_callback' => [ $this, 'permission_edit_others_posts' ],
		],
	];

	\register_rest_route( Main::API_V1_NAMESPACE, self::LEAST_READABILITY_ROUTE, $least_readability_route );

	$least_seo_score_route = [
		[
			'methods'             => 'GET',
			'callback'            => [ $this, 'get_least_seo_score' ],
			'permission_callback' => [ $this, 'permission_edit_others_posts' ],
		],
	];

	\register_rest_route( Main::API_V1_NAMESPACE, self::LEAST_SEO_SCORE_ROUTE, $least_seo_score_route );

	$most_linked_route = [
		[
			'methods'             => 'GET',
			'callback'            => [ $this, 'get_most_linked' ],
			'permission_callback' => [ $this, 'permission_edit_others_posts' ],
		],
	];

	\register_rest_route( Main::API_V1_NAMESPACE, self::MOST_LINKED_ROUTE, $most_linked_route );

	$least_linked_route = [
		[
			'methods'             => 'GET',
			'callback'            => [ $this, 'get_least_linked' ],
			'permission_callback' => [ $this, 'permission_edit_others_posts' ],
		],
	];

	\register_rest_route( Main::API_V1_NAMESPACE, self::LEAST_LINKED_ROUTE, $least_linked_route );

	$update_ignored_indexables_route = [
		[
			'methods'             => 'POST',
			'callback'            => [ $this, 'update_ignored_indexables' ],
			'permission_callback' => [ $this, 'permission_edit_others_posts' ],
			'args'                => [
				'id' => [
					'type'     => 'integer',
					'minimum'  => 0,
				],
				'type' => [
					'type'     => 'string',
					'enum'     => [
						'least_readability',
						'least_seo_score',
						'most_linked',
						'least_linked',
					],
				],
			],
		],
	];

	\register_rest_route( Main::API_V1_NAMESPACE, self::UPDATE_IGNORED_INDEXABLES_ROUTE, $update_ignored_indexables_route );

	$restore_indexable_route = [
		[
			'methods'             => 'POST',
			'callback'            => [ $this, 'restore_indexable' ],
			'permission_callback' => [ $this, 'permission_edit_others_posts' ],
			'args'                => [
				'id' => [
					'type'     => 'integer',
					'minimum'  => 0,
				],
				'type' => [
					'type'     => 'string',
					'enum'     => [
						'least_readability',
						'least_seo_score',
						'most_linked',
						'least_linked',
					],
				],
			],
		],
	];

	\register_rest_route( Main::API_V1_NAMESPACE, self::RESTORE_INDEXABLE_ROUTE, $restore_indexable_route );

	$restore_all_indexables_route = [
		[
			'methods'             => 'POST',
			'callback'            => [ $this, 'restore_all_indexables' ],
			'permission_callback' => [ $this, 'permission_edit_others_posts' ],
		],
	];

	\register_rest_route( Main::API_V1_NAMESPACE, self::RESTORE_ALL_INDEXABLES_ROUTE, $restore_all_indexables_route );

	$restore_all_indexables_for_list_route = [
		[
			'methods'             => 'POST',
			'callback'            => [ $this, 'restore_all_indexables_for_list' ],
			'permission_callback' => [ $this, 'permission_edit_others_posts' ],
			'args'                => [
				'type' => [
					'type'     => 'string',
					'enum'     => [
						'least_readability',
						'least_seo_score',
						'most_linked',
						'least_linked',
					],
				],
			],
		],
	];

	\register_rest_route( Main::API_V1_NAMESPACE, self::RESTORE_ALL_INDEXABLES_FOR_LIST_ROUTE, $restore_all_indexables_for_list_route );

	$get_reading_list_route = [
		[
			'methods'             => 'GET',
			'callback'            => [ $this, 'get_reading_list' ],
			'permission_callback' => [ $this, 'permission_edit_others_posts' ],
		],
	];

	\register_rest_route( Main::API_V1_NAMESPACE, self::GET_READING_LIST_STATE, $get_reading_list_route );

	$set_reading_list_route = [
		[
			'methods'             => 'POST',
			'callback'            => [ $this, 'set_reading_list' ],
			'permission_callback' => [ $this, 'permission_edit_others_posts' ],
			'args'                => [
				'state' => [
					'type'     => 'array',
				],
			],
		],
	];

	\register_rest_route( Main::API_V1_NAMESPACE, self::SET_READING_LIST_STATE, $set_reading_list_route );
}