WPSEO_Upgrade::cleanup_option_data()
Cleans the option to make sure only relevant settings are there.
Метод класса: WPSEO_Upgrade{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->cleanup_option_data( $option_name );
- $option_name(строка) (обязательный)
- Option name save.
Код WPSEO_Upgrade::cleanup_option_data() WPSEO Upgrade::cleanup option data Yoast 25.0
protected function cleanup_option_data( $option_name ) { $data = get_option( $option_name, [] ); if ( ! is_array( $data ) || $data === [] ) { return; } /* * Clean up the option by re-saving it. * * The option framework will remove any settings that are not configured * for this option, removing any migrated settings. */ update_option( $option_name, $data ); }