public function registerControls($controls)
    {
        $data = $this->getData();
        $customControls = $data['controls'];
        foreach ($customControls as &$c) {
            $c['label'] = $this->translateValueIfKeyExists($c, 'label');
            $c['description'] = $this->translateValueIfKeyExists($c, 'description');
            $c['default'] = $this->translateValueIfKeyExists($c, 'default');
            $c['help'] = $this->translateValueIfKeyExists($c, 'help');

            if (isset($c['choices'])) {
                foreach ($c['choices'] as $id => $label) {
                    if (isset($label)) {
                        $c['choices'][$id] = Strings::translate($label);
                    }
                }
            }
        }
        return array_merge($controls, $customControls);
    }
public function registerControls($controls)
    {
        $data = $this->getData();
        $customControls = $data['controls'];
        foreach ($customControls as &$c) {
            $c['label'] = $this->translateValueIfKeyExists($c, 'label');
            $c['description'] = $this->translateValueIfKeyExists($c, 'description');
            $c['default'] = $this->translateValueIfKeyExists($c, 'default');
            $c['help'] = $this->translateValueIfKeyExists($c, 'help');

            if (isset($c['choices'])) {
                foreach ($c['choices'] as $id => $label) {
                    if (isset($label)) {
                        $c['choices'][$id] = Strings::translate($label);
                    }
                }
            }
        }
        return array_merge($controls, $customControls);
    }
public function registerControls ( $ controls ) { $ data = $ this -> getData ( ) ; $ customControls = $ data [ 'controls' ] ; foreach ( $ customControls as & $ c ) { $ c [ 'label' ] = $ this -> translateValueIfKeyExists ( $ c , 'label' ) ; $ c [ 'description' ] = $ this -> translateValueIfKeyExists ( $ c , 'description' ) ; $ c [ 'default' ] = $ this -> translateValueIfKeyExists ( $ c , 'default' ) ; $ c [ 'help' ] = $ this -> translateValueIfKeyExists ( $ c , 'help' ) ; if ( isset ( $ c [ 'choices' ] ) ) { foreach ( $ c [ 'choices' ] as $ id => $ label ) { if ( isset ( $ label ) ) { $ c [ 'choices' ] [ $ id ] = Strings :: translate ( $ label ) ; } } } } return array_merge ( $ controls , $ customControls ) ; }
Register the controls in the various panels and sections
@param array $controls The controls to register
@return array The augmented controls array
Register the controls in the various panels and sections