Yoast\WP\SEO\Repositories

Indexable_Cleanup_Repository::count_indexables_for_non_publicly_viewable_taxonomiespublicYoast 1.0

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_viewable_taxonomies();

Код Indexable_Cleanup_Repository::count_indexables_for_non_publicly_viewable_taxonomies() Yoast 28.1

public function count_indexables_for_non_publicly_viewable_taxonomies() {
	$included_taxonomies = $this->taxonomy->get_indexable_taxonomies();
	if ( empty( $included_taxonomies ) ) {
		return $this
			->query()
			->where( 'object_type', 'term' )
			->where_not_equal( 'object_sub_type', 'null' )
			->count();
	}
	else {
		return $this
			->query()
			->where( 'object_type', 'term' )
			->where_not_equal( 'object_sub_type', 'null' )
			->where_not_in( 'object_sub_type', $included_taxonomies )
			->count();
	}
}