Yoast\WP\SEO\Helpers

Post_Type_Helper::is_indexable()publicYoast 1.0

Checks if the request post type is public and indexable.

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

Хуков нет.

Возвращает

true|false. True when post type is set to index.

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

$Post_Type_Helper = new Post_Type_Helper();
$Post_Type_Helper->is_indexable( $post_type_name );
$post_type_name(строка) (обязательный)
The name of the post type to lookup.

Код Post_Type_Helper::is_indexable() Yoast 22.4

public function is_indexable( $post_type_name ) {
	if ( $this->options_helper->get( 'disable-' . $post_type_name, false ) ) {
		return false;
	}

	return ( $this->options_helper->get( 'noindex-' . $post_type_name, false ) === false );
}