Yoast\WP\SEO\Abilities\Application

Author_Schema_Updater::get_settings │ private │ Yoast 1.0

Returns the current value of each field, read from its repository and cast to the type its schema declares.

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

Хуков нет.

Возвращает

array<string, mixed>. The current value of each field.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_settings( $user_id, $fields ): array;
$user_id(int) (обязательный)
The ID of the user.
$fields(массив) (обязательный)
.

Код Author_Schema_Updater::get_settings() Yoast 28.9

private function get_settings( int $user_id, array $fields ): array {
	$settings     = [];
	$repositories = $this->field_map->get_repositories();

	foreach ( $fields as $field_name => $schema ) {
		$settings[ $field_name ] = $this->cast_to_schema_type( $repositories[ $field_name ]->get( $user_id, $field_name ), $schema );
	}

	return $settings;
}