Yoast\WP\SEO\Routes

Yoast_Head_REST_Field::register_routes()publicYoast 1.0

Registers routes with WordPress.

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

Хуков нет.

Возвращает

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

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

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

Код Yoast_Head_REST_Field::register_routes() Yoast 22.4

public function register_routes() {
	$public_post_types = $this->post_type_helper->get_indexable_post_types();

	foreach ( $public_post_types as $post_type ) {
		$this->register_rest_fields( $post_type, 'for_post' );
	}

	$public_taxonomies = $this->taxonomy_helper->get_indexable_taxonomies();

	foreach ( $public_taxonomies as $taxonomy ) {
		if ( $taxonomy === 'post_tag' ) {
			$taxonomy = 'tag';
		}
		$this->register_rest_fields( $taxonomy, 'for_term' );
	}

	$this->register_rest_fields( 'user', 'for_author' );
	$this->register_rest_fields( 'type', 'for_post_type_archive' );
}