Yoast\WP\SEO\Integrations\Watchers
Option_Wpseo_Watcher::check_semrush_option_disabled() public Yoast 1.0
Checks if the SEMrush integration is disabled; if so, deletes the tokens.
We delete the tokens if the SEMrush integration is disabled, no matter if the value has actually changed or not.
{} Это метод класса: Option_Wpseo_Watcher{}
Хуков нет.
Возвращает
true/false. Whether the SEMrush tokens have been deleted or not.
Использование
$Option_Wpseo_Watcher = new Option_Wpseo_Watcher(); $Option_Wpseo_Watcher->check_semrush_option_disabled( $old_value, $new_value );
- $old_value(массив) (обязательный)
- The old value of the option.
- $new_value(массив) (обязательный)
- The new value of the option.
Код Option_Wpseo_Watcher::check_semrush_option_disabled() Option Wpseo Watcher::check semrush option disabled Yoast 15.7
public function check_semrush_option_disabled( $old_value, $new_value ) {
if ( \array_key_exists( 'semrush_integration_active', $new_value )
&& $new_value['semrush_integration_active'] === false ) {
\YoastSEO()->helpers->options->set( 'semrush_tokens', [] );
return true;
}
return false;
}