Yoast\WP\SEO\Dashboard\Application\Taxonomies
Taxonomies_Repository::get_content_type_taxonomy
Returns the object of the filtering taxonomy of a content type.
Метод класса: Taxonomies_Repository{}
Хуков нет.
Возвращает
Taxonomy|null. The filtering taxonomy of the content type.
Использование
$Taxonomies_Repository = new Taxonomies_Repository(); $Taxonomies_Repository->get_content_type_taxonomy( $content_type );
- $content_type(строка) (обязательный)
- The content type that the taxonomy filters.
Код Taxonomies_Repository::get_content_type_taxonomy() Taxonomies Repository::get content type taxonomy Yoast 27.6
public function get_content_type_taxonomy( string $content_type ) {
// First we check if there's a filter that overrides the filtering taxonomy for this content type.
$taxonomy = $this->taxonomies_collector->get_custom_filtering_taxonomy( $content_type );
if ( $taxonomy ) {
return $taxonomy;
}
// Then we check if there is a filter explicitly made for this content type.
$taxonomy = $this->filter_pairs_repository->get_taxonomy( $content_type );
if ( $taxonomy ) {
return $taxonomy;
}
// If everything else returned empty, we can always try the fallback taxonomy.
return $this->taxonomies_collector->get_fallback_taxonomy( $content_type );
}