Yoast\WP\SEO\Repositories
Indexable_Cleanup_Repository::count_indexables_with_post_status
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() Indexable Cleanup Repository::count indexables with post status Yoast 26.5
public function count_indexables_with_post_status( string $post_status ) {
return $this
->query()
->where( 'object_type', 'post' )
->where( 'post_status', $post_status )
->count();
}