Yoast\WP\SEO\Integrations\Watchers
Indexable_Permalink_Watcher::get_taxonomies_for_post_types() protected Yoast 1.0
Retrieves the taxonomies that belongs to the public post types.
{} Это метод класса: Indexable_Permalink_Watcher{}
Хуков нет.
Возвращает
Массив. The retrieved taxonomies.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_taxonomies_for_post_types( $post_types );
- $post_types(массив) (обязательный)
- The post types to get taxonomies for.
Код Indexable_Permalink_Watcher::get_taxonomies_for_post_types() Indexable Permalink Watcher::get taxonomies for post types Yoast 15.7
protected function get_taxonomies_for_post_types( $post_types ) {
$taxonomies = [];
foreach ( $post_types as $post_type ) {
$taxonomies[] = \get_object_taxonomies( $post_type, 'names' );
}
$taxonomies = \array_merge( [], ...$taxonomies );
$taxonomies = \array_unique( $taxonomies );
return $taxonomies;
}