WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WPSEO_Option::retain_variable_keys() protected Yoast 1.0

Make sure that any set option values relating to post_types and/or taxonomies are retained, even when that post_type or taxonomy may not yet have been registered.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

{@internal The wpseo_titles concrete class overrules this method. Make sure that any changes applied here, also get ported to that version.}}

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

Хуков нет.

Возвращает

Массив.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->retain_variable_keys( $dirty, $clean );
$dirty(массив) (обязательный)
Original option as retrieved from the database.
$clean(массив) (обязательный)
Filtered option where any options which shouldn't be in our option have already been removed and any options which weren't set have been set to their defaults.

Код WPSEO_Option::retain_variable_keys() Yoast 17.4

protected function retain_variable_keys( $dirty, $clean ) {
	if ( ( is_array( $this->variable_array_key_patterns ) && $this->variable_array_key_patterns !== [] ) && ( is_array( $dirty ) && $dirty !== [] ) ) {
		foreach ( $dirty as $key => $value ) {

			// Do nothing if already in filtered options.
			if ( isset( $clean[ $key ] ) ) {
				continue;
			}

			foreach ( $this->variable_array_key_patterns as $pattern ) {

				if ( strpos( $key, $pattern ) === 0 ) {
					$clean[ $key ] = $value;
					break;
				}
			}
		}
	}

	return $clean;
}