Yoast\WP\SEO\Llms_Txt\User_Interface

Enable_Llms_Txt_Option_Watcher::check_toggle_llms_txtpublicYoast 1.0

Checks if the LLMS.txt feature is toggled.

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

Хуков нет.

Возвращает

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

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

$Enable_Llms_Txt_Option_Watcher = new Enable_Llms_Txt_Option_Watcher();
$Enable_Llms_Txt_Option_Watcher->check_toggle_llms_txt( $old_value, $new_value ): void;
$old_value(array<string|int|true|false|array<string|int|bool>>) (обязательный)
The old value of the option.
$new_value(array<string|int|true|false|array<string|int|bool>>) (обязательный)
The new value of the option.

Код Enable_Llms_Txt_Option_Watcher::check_toggle_llms_txt() Yoast 26.9

public function check_toggle_llms_txt( $old_value, $new_value ): void {
	$option_name = 'enable_llms_txt';

	if ( \array_key_exists( $option_name, $old_value ) && \array_key_exists( $option_name, $new_value ) && $old_value[ $option_name ] !== $new_value[ $option_name ] ) {
		if ( $new_value[ $option_name ] === true ) {
			$this->scheduler->schedule_weekly_llms_txt_population();
			$this->populate_file_command_handler->handle();
		}
		else {
			$this->scheduler->unschedule_llms_txt_population();
			$this->remove_file_command_handler->handle();
		}
	}
}