Yoast\WP\SEO\Repositories
Indexable_Cleanup_Repository::count_indexables_for_non_publicly_post_type_archive_pages
Counts indexables for non publicly viewable taxonomies.
Метод класса: Indexable_Cleanup_Repository{}
Хуков нет.
Возвращает
float|int.
Использование
$Indexable_Cleanup_Repository = new Indexable_Cleanup_Repository(); $Indexable_Cleanup_Repository->count_indexables_for_non_publicly_post_type_archive_pages();
Код Indexable_Cleanup_Repository::count_indexables_for_non_publicly_post_type_archive_pages() Indexable Cleanup Repository::count indexables for non publicly post type archive pages Yoast 28.6
public function count_indexables_for_non_publicly_post_type_archive_pages() {
$included_post_types = $this->post_type->get_indexable_post_archives();
$post_archives = [];
foreach ( $included_post_types as $post_type ) {
$post_archives[] = $post_type->name;
}
if ( empty( $post_archives ) ) {
return $this
->query()
->where( 'object_type', 'post-type-archive' )
->where_not_equal( 'object_sub_type', 'null' )
->count();
}
return $this
->query()
->where( 'object_type', 'post-type-archive' )
->where_not_equal( 'object_sub_type', 'null' )
->where_not_in( 'object_sub_type', $post_archives )
->count();
}