Yoast\WP\SEO\Helpers

Post_Type_Helper::get_indexable_post_type_objects()publicYoast 1.0

Returns an array of complete post type objects for all indexable post types.

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

Хуков нет.

Возвращает

Массив. List of indexable post type objects.

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

$Post_Type_Helper = new Post_Type_Helper();
$Post_Type_Helper->get_indexable_post_type_objects();

Код Post_Type_Helper::get_indexable_post_type_objects() Yoast 24.4

public function get_indexable_post_type_objects() {
	$post_type_objects    = [];
	$indexable_post_types = $this->get_indexable_post_types();
	foreach ( $indexable_post_types as $post_type ) {
		$post_type_object = \get_post_type_object( $post_type );
		if ( ! empty( $post_type_object ) ) {
			$post_type_objects[ $post_type ] = $post_type_object;
		}
	}

	return $post_type_objects;
}