芝麻web文件管理V1.00
编辑当前文件:/home/elegucvf/public_html/src/dashboard/application/taxonomies/taxonomies-repository.php
taxonomies_collector = $taxonomies_collector; $this->filter_pairs_repository = $filter_pairs_repository; } /** * Returns the object of the filtering taxonomy of a content type. * * @param string $content_type The content type that the taxonomy filters. * * @return Taxonomy|null The filtering taxonomy of the content type. */ 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 ); } }