l10n = wp_parse_args( $this->l10n, array( 'top' => esc_html__( 'Top', 'armonia' ), 'right' => esc_html__( 'Right', 'armonia' ), 'bottom' => esc_html__( 'Bottom', 'armonia' ), 'left' => esc_html__( 'Left', 'armonia' ) ) ); } /** * Enqueue scripts/styles. * * @since 3.4.0 */ public function enqueue() { wp_enqueue_style( 'armonia-customizer-spacing-control', get_template_directory_uri() . '/inc/customizer/custom-controls/spacing-control/spacing-control.css', array(), ARMONIA_VERSION, 'all' ); wp_enqueue_script( 'armonia-customizer-spacing-control', get_template_directory_uri() . '/inc/customizer/custom-controls/spacing-control/spacing-control.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 ), 'label' => isset( $this->l10n[ $setting_key ] ) ? $this->l10n[ $setting_key ] : '' ); } $this->json['linkTitle'] = esc_html__( 'Link fields', 'armonia' ); } /** * 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 }}} <# } #>