/** * Gather the parameters passed to client JavaScript via JSON. * * @return array The array to be exported to the client as JSON. */ public function json() { $array = parent::json(); // Backwards compatibility $array['panel'] = $array['screen']; unset($array['screen']); }
/** * Gather the parameters passed to client JavaScript via JSON. * * @return array The array to be exported to the client as JSON. */ public function json() { $array = parent::json(); if ($this->screen) { /* translators: ▸ is the unicode right-pointing triangle, and %s is the section title in the Customizer */ $array['customizeAction'] = sprintf(__('Customizing ▸ %s'), esc_html($this->manager->get_panel($this->screen)->title)); } else { $array['customizeAction'] = __('Customizing'); } // Backwards compatibility for old property names foreach ($this->property_map as $backcompat_arg => $actual_arg) { if (isset($array[$actual_arg])) { $array[$backcompat_arg] = $array[$actual_arg]; } } return $array; }