media_query ) ) {
wp_enqueue_script( 'responsive-switchers', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/common-functionalities/responsive-switchers.js', array( 'jquery' ), HESTIA_VERSION, true );
}
}
/**
* Renders the control wrapper and calls $this->render_content() for the internals.
*
* @see WP_Customize_Control::render()
*/
protected function render() {
$id = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id );
$class = 'customize-control has-switchers customize-control-' . $this->type;
?>
render_content(); ?>
id;
$json['link'] = $this->get_link();
$json['media_query'] = $this->media_query;
$json['inputAttrs'] = '';
$json['default_value'] = ! empty( $this->setting->default ) ? $this->setting->default : '';
foreach ( $this->input_attrs as $attr => $value ) {
$json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
}
$value = $this->value();
$media_queries = array( 'desktop', 'tablet', 'mobile' );
foreach ( $media_queries as $query ) {
$json[ $query ] = array(
$query . '_vertical' => '',
$query . '_horizontal' => '',
);
}
if ( ! empty( $value ) ) {
$decoded_value = json_decode( $value );
if ( ! empty( $decoded_value ) ) {
foreach ( $decoded_value as $media => $value ) {
$media_values = json_decode( $value );
if ( ! empty( $media_values ) ) {
$json[ $media ] = $media_values;
}
}
}
}
return $json;
}
/**
* An Underscore (JS) template for this control's content (but not its container).
*
* Class variables for this control class are available in the `data` JS object;
* export custom variables by overriding {@see WP_Customize_Control::to_json()}.
*
* @see WP_Customize_Control::print_template()
*
* @access protected
*/
protected function content_template() {
?>
<# if ( data.label ) { #>
{{{ data.label }}}
<# if ( data.media_query ) { #>
<# } #>
<# } #>
<# if ( data.description ) { #>
{{{ data.description }}}
<# } #>