Yoast\WP\SEO\Helpers
Indexing_Helper::get_limited_unindexed_count
Returns a limited number of unindexed objects.
Метод класса: Indexing_Helper{}
Хуков нет.
Возвращает
int. The total number of unindexed objects.
Использование
$Indexing_Helper = new Indexing_Helper(); $Indexing_Helper->get_limited_unindexed_count( $limit, $actions );
- $limit(int) (обязательный)
- Limit the number of unindexed objects that are counted.
- $actions(Indexation_Action_Interface[]|Limited_Indexing_Action_Interface[])
- The actions whose counts will be calculated.
По умолчанию:[]
Код Indexing_Helper::get_limited_unindexed_count() Indexing Helper::get limited unindexed count Yoast 27.6
public function get_limited_unindexed_count( $limit, $actions = [] ) {
$unindexed_count = 0;
if ( empty( $actions ) ) {
$actions = $this->indexing_actions;
}
foreach ( $actions as $action ) {
$unindexed_count += $action->get_limited_unindexed_count( $limit - $unindexed_count + 1 );
if ( $unindexed_count > $limit ) {
return $unindexed_count;
}
}
return $unindexed_count;
}