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

WPSEO_Option_Titles::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 Overrule the abstract class version of this to make sure one extra renamed variable key does not get removed. IMPORTANT: keep this method in line with the parent on which it is based!}}

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

Возвращает

Массив.

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

// 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_Titles::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 !== [] ) ) {

		// Add the extra pattern.
		$patterns   = $this->variable_array_key_patterns;
		$patterns[] = 'tax-hideeditbox-';

		/**
		 * Allow altering the array with variable array key patterns.
		 *
		 * @api  array  $patterns  Array with the variable array key patterns.
		 */
		$patterns = apply_filters( 'wpseo_option_titles_variable_array_key_patterns', $patterns );

		foreach ( $dirty as $key => $value ) {

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

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

	return $clean;
}