WP_Customize_Setting::aggregate_multidimensional PHP Method

aggregate_multidimensional() protected method

When a multidimensional setting gets aggregated, all of its preview and update calls get combined into one call, greatly improving performance.
Since: 4.4.0
    protected function aggregate_multidimensional()
    {
        $id_base = $this->id_data['base'];
        if (!isset(self::$aggregated_multidimensionals[$this->type])) {
            self::$aggregated_multidimensionals[$this->type] = array();
        }
        if (!isset(self::$aggregated_multidimensionals[$this->type][$id_base])) {
            self::$aggregated_multidimensionals[$this->type][$id_base] = array('previewed_instances' => array(), 'preview_applied_instances' => array(), 'root_value' => $this->get_root_value(array()));
        }
        if (!empty($this->id_data['keys'])) {
            // Note the preview-applied flag is cleared at priority 9 to ensure it is cleared before a deferred-preview runs.
            add_action("customize_post_value_set_{$this->id}", array($this, '_clear_aggregated_multidimensional_preview_applied_flag'), 9);
            $this->is_multidimensional_aggregated = true;
        }
    }