Yoast\WP\SEO\Llms_Txt\Infrastructure\Markdown_Services
Terms_Collector::get_terms_lists
Returns the content types in a link list.
Метод класса: Terms_Collector{}
Хуков нет.
Возвращает
Link_List[]. The content types in a link list.
Использование
$Terms_Collector = new Terms_Collector(); $Terms_Collector->get_terms_lists(): array;
Код Terms_Collector::get_terms_lists() Terms Collector::get terms lists Yoast 26.9
public function get_terms_lists(): array {
$taxonomies = $this->taxonomy_helper->get_indexable_taxonomy_objects();
$link_list = [];
foreach ( $taxonomies as $taxonomy ) {
if ( $this->taxonomy_helper->is_indexable( $taxonomy->name ) === false ) {
continue;
}
$terms = \get_categories(
[
'taxonomy' => $taxonomy->name,
'number' => 5,
'orderby' => 'count',
'order' => 'DESC',
]
);
$term_links = new Link_List( $taxonomy->label, [] );
foreach ( $terms as $term ) {
$term_link = new Link( $term->name, \get_term_link( $term, $taxonomy->name ) );
$term_links->add_link( $term_link );
}
$link_list[] = $term_links;
}
return $link_list;
}