Yoast\WP\SEO\Dashboard\User_Interface\Scores

Abstract_Scores_Route::get_content_type()protectedYoast 1.0

Gets the content type object.

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

Хуков нет.

Возвращает

Content_Type|null. The content type object.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_content_type( $content_type ): ?Content_Type;
$content_type(строка) (обязательный)
The content type.

Код Abstract_Scores_Route::get_content_type() Yoast 24.4

protected function get_content_type( string $content_type ): ?Content_Type {
	$content_types = $this->content_types_collector->get_content_types()->get();

	if ( isset( $content_types[ $content_type ] ) && \is_a( $content_types[ $content_type ], Content_Type::class ) ) {
		return $content_types[ $content_type ];
	}

	throw new Exception( 'Invalid content type.', 400 );
}