WPSEO_Option::update_site_option()publicYoast 1.0

Update a site_option.

{@internal This special method is only needed for multisite options, but very needed indeed there. The order in which certain functions and hooks are run is different between get_option() and get_site_option() which means in practice that the removing of the default filters would be done too late and the re-adding of the default filters might not be done at all. Aka: use the WPSEO_Options::update_site_option() method (which calls this method) for safely adding/updating multisite options.}}

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

Хуков нет.

Возвращает

true|false. Whether the update was successful.

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

$WPSEO_Option = new WPSEO_Option();
$WPSEO_Option->update_site_option( $value );
$value(разное) (обязательный)
The new value for the option.

Код WPSEO_Option::update_site_option() Yoast 22.4

public function update_site_option( $value ) {
	if ( $this->multisite_only === true && is_multisite() ) {
		$this->remove_default_filters();
		$result = update_site_option( $this->option_name, $value );
		$this->add_default_filters();

		return $result;
	}
	else {
		return false;
	}
}