Yoast\WP\SEO\Dashboard\Domain\Content_Types

Content_Types_List::to_array()publicYoast 1.0

Parses the content type list to the expected key value representation.

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

Хуков нет.

Возвращает

Массив<Массив<Строку,Массив<Строку,. array<string, array<string, string|null>>>>> The content type list presented as the expected key value representation.

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

$Content_Types_List = new Content_Types_List();
$Content_Types_List->to_array(): array;

Код Content_Types_List::to_array() Yoast 24.4

public function to_array(): array {
	$array = [];
	foreach ( $this->content_types as $content_type ) {
		$array[] = [
			'name'     => $content_type->get_name(),
			'label'    => $content_type->get_label(),
			'taxonomy' => ( $content_type->get_taxonomy() ) ? $content_type->get_taxonomy()->to_array() : null,
		];
	}

	return $array;
}