Yoast\WP\SEO\Analytics\User_Interface

Last_Completed_Indexation_Integration::maybe_set_indexables_unindexed_calculated │ public │ Yoast 1.0

Saves a timestamp option when there are no unindexed indexables.

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

Хуков нет.

Возвращает

void. Ничего (null).

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

$Last_Completed_Indexation_Integration = new Last_Completed_Indexation_Integration();
$Last_Completed_Indexation_Integration->maybe_set_indexables_unindexed_calculated( $indexable_name, $count ): void;
$indexable_name(строка) (обязательный)
The name of the indexable that is being checked.
$count(int) (обязательный)
The amount of missing indexables.

Код Last_Completed_Indexation_Integration::maybe_set_indexables_unindexed_calculated() Yoast 28.7

public function maybe_set_indexables_unindexed_calculated( string $indexable_name, int $count ): void {
	if ( $count === 0 ) {
		$no_index                    = $this->options_helper->get( 'last_known_no_unindexed', [] );
		$no_index[ $indexable_name ] = \time();

		\remove_action( 'update_option_wpseo', [ 'WPSEO_Utils', 'clear_cache' ] );
		$this->options_helper->set( 'last_known_no_unindexed', $no_index );
		\add_action( 'update_option_wpseo', [ 'WPSEO_Utils', 'clear_cache' ] );
	}
}