l10n = wp_parse_args( $this->l10n, array( 'color' => esc_html__( 'Color', 'armonia' ), 'hover_color' => esc_html__( 'Hover Color', 'armonia' ), 'secondary_color' => esc_html__( 'Secondary Color', 'armonia' ), 'border' => esc_html__( 'Border', 'armonia' ), 'border_width' => esc_html__( 'Border Width (px)', 'armonia' ), 'border_radius' => esc_html__( 'Border Radius (%)', 'armonia' ), 'background_type' => esc_html__( 'Background Type', 'armonia' ) ) ); } /** * Enqueue scripts/styles. * * @since 3.4.0 */ public function enqueue() { wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_style( 'armonia-customizer-control-group-control', get_template_directory_uri() . '/inc/customizer/custom-controls/control-group-control/control-group.css', array(), ARMONIA_VERSION, 'all' ); wp_enqueue_script( 'armonia-customizer-control-group-control', get_template_directory_uri() . '/inc/customizer/custom-controls/control-group-control/control-group.js', array( 'jquery' ), ARMONIA_VERSION, true ); } /** * Add custom parameters to pass to the JS via JSON. * * @since 1.0.0 * @access public * @return void */ public function to_json() { parent::to_json(); // Loop through each of the settings and set up the data for it. foreach ( $this->settings as $setting_key => $setting_id ) { $this->json[ $setting_key ] = array( 'link' => $this->get_link( $setting_key ), 'value' => $this->value( $setting_key ), 'defaultValue' => $setting_id->default, 'label' => isset( $this->l10n[ $setting_key ] ) ? $this->l10n[ $setting_key ] : '' ); } } /** * Underscore JS template to handle the control's output. * * @since 1.0.0 * @access public * @return void */ public function content_template() { ?> <# if ( data.label ) { #>
{{ data.label }}
<# } #> <# if ( data.description ) { #> {{{ data.description }}} <# } #>