Yoast\WP\SEO\Dashboard\Infrastructure\Content_Types

Content_Types_Collector::get_content_types()publicYoast 1.0

Returns the content types in a list.

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

Хуков нет.

Возвращает

Content_Types_List. The content types in a list.

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

$Content_Types_Collector = new Content_Types_Collector();
$Content_Types_Collector->get_content_types(): Content_Types_List;

Код Content_Types_Collector::get_content_types() Yoast 24.4

public function get_content_types(): Content_Types_List {
	$content_types_list = new Content_Types_List();
	$post_types         = $this->post_type_helper->get_indexable_post_type_objects();

	foreach ( $post_types as $post_type_object ) {
		if ( $post_type_object->show_ui === false ) {
			continue;
		}

		$content_type = new Content_Type( $post_type_object->name, $post_type_object->label );
		$content_types_list->add( $content_type );
	}

	return $content_types_list;
}