Yoast\WP\SEO\Abilities\Application

Archive_And_Special_Page_SEO_Settings_Updater::save_field │ protected │ Yoast 1.0

Saves a single field in the option it is stored in for the target.

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

Хуков нет.

Возвращает

bool. Whether the field was saved.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->save_field( $field_name, $value, $context ): bool;
$field_name(строка) (обязательный)
The name of the field.
$value(разное) (обязательный)
The value to save.
$context(array<string, mixed>) (обязательный)
The target, under 'target'.

Код Archive_And_Special_Page_SEO_Settings_Updater::save_field() Yoast 28.9

protected function save_field( string $field_name, $value, array $context ): bool {
	$option_name = $this->field_map->get_option_name( $field_name, $context['target'] );
	if ( $option_name === null ) {
		return false;
	}

	return $this->options_helper->set( $option_name, $value ) === true;
}