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

WP_Customize_Setting::_multidimensional_preview_filter() public WP 4.4.0

Callback function to filter multidimensional theme mods and options.

For all multidimensional settings of a given type, the preview filter for the first setting previewed will be used to apply the values for the others.

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

Хуков нет.


Разное. New or old value.


$WP_Customize_Setting = new WP_Customize_Setting();
$WP_Customize_Setting->_multidimensional_preview_filter( $original );
$original(разное) (обязательный)
Original root value.


  • Смотрите: WP_Customize_Setting::$aggregated_multidimensionals

Список изменений

С версии 4.4.0 Введена.

Код WP_Customize_Setting::_multidimensional_preview_filter() WP 5.8.1

final public function _multidimensional_preview_filter( $original ) {
	if ( ! $this->is_current_blog_previewed() ) {
		return $original;

	$id_base = $this->id_data['base'];

	// If no settings have been previewed yet (which should not be the case, since $this is), just pass through the original value.
	if ( empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] ) ) {
		return $original;

	foreach ( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] as $previewed_setting ) {
		// Skip applying previewed value for any settings that have already been applied.
		if ( ! empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['preview_applied_instances'][ $previewed_setting->id ] ) ) {

		// Do the replacements of the posted/default sub value into the root value.
		$value = $previewed_setting->post_value( $previewed_setting->default );
		$root  = self::$aggregated_multidimensionals[ $previewed_setting->type ][ $id_base ]['root_value'];
		$root  = $previewed_setting->multidimensional_replace( $root, $previewed_setting->id_data['keys'], $value );
		self::$aggregated_multidimensionals[ $previewed_setting->type ][ $id_base ]['root_value'] = $root;

		// Mark this setting having been applied so that it will be skipped when the filter is called again.
		self::$aggregated_multidimensionals[ $previewed_setting->type ][ $id_base ]['preview_applied_instances'][ $previewed_setting->id ] = true;

	return self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value'];