Yoast\WP\SEO\Repositories

Indexable_Cleanup_Repository::count_indexables_with_post_status()publicYoast 1.0

Counts indexables with a certain post status.

Метод класса: Indexable_Cleanup_Repository{}

Хуков нет.

Возвращает

float|int.

Использование

$Indexable_Cleanup_Repository = new Indexable_Cleanup_Repository();
$Indexable_Cleanup_Repository->count_indexables_with_post_status( $post_status );
$post_status(строка) (обязательный)
The post status to count.

Код Indexable_Cleanup_Repository::count_indexables_with_post_status() Yoast 24.0

public function count_indexables_with_post_status( string $post_status ) {
	return $this
		->query()
		->where( 'object_type', 'post' )
		->where( 'post_status', $post_status )
		->count();
}