WPSEO_Option::add_default_filters_if_not_changed()publicYoast 1.0

Adds back the default filters that were removed during validation if the option was not changed. This is because in that case the latter actions are not called and thus the filters are never added back.

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

Хуков нет.


Строку. The current value.


$WPSEO_Option = new WPSEO_Option();
$WPSEO_Option->add_default_filters_if_not_changed( $value, $option_name, $old_value );
$value(разное) (обязательный)
The current value.
$option_name(строка) (обязательный)
The option name.
$old_value(разное) (обязательный)
The old value.

Код WPSEO_Option::add_default_filters_if_not_changed() Yoast 19.7.1

public function add_default_filters_if_not_changed( $value, $option_name, $old_value ) {
	if ( $option_name !== $this->option_name ) {
		return $value;

	if ( $value === $old_value || maybe_serialize( $value ) === maybe_serialize( $old_value ) ) {

	return $value;