default ) ) { $this->json['default'] = $this->default; } else{ $this->json['default'] = $this->setting->default; } $this->json['value'] = $this->value(); $this->json['link'] = $this->get_link(); $this->json['id'] = $this->id; $this->json['tooltip'] = $this->tooltip; $this->json['inputAttrs'] = ''; foreach ( $this->input_attrs as $attr => $value ) { $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; } } protected function content_template() { ?> <# if ( data.tooltip ) { #> <# } #> default ) ) { $this->json['default'] = $this->default; } else { $this->json['default'] = $this->setting->default; } $this->json['value'] = $this->value(); $this->json['link'] = $this->get_link(); $this->json['id'] = $this->id; $this->json['tooltip'] = $this->tooltip; $this->json['choices'] = $this->choices; $this->json['inputAttrs'] = ''; foreach ( $this->input_attrs as $attr => $value ) { $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; } } protected function content_template() { ?> <# if ( data.tooltip ) { #> <# } #>
<# for ( key in data.choices ) { #> <# dataAlt = ( _.isObject( data.choices[ key ] ) && ! _.isUndefined( data.choices[ key ].alt ) ) ? data.choices[ key ].alt : '' #> checked="checked"<# } #> data-alt="{{ dataAlt }}"> <# } #>
fields = $fields; $this->sophia_after_dark_box_label = $args['sophia_after_dark_box_label_text'] ; $this->sophia_after_dark_box_add_control = $args['sophia_after_dark_box_add_control_text']; parent::__construct( $manager, $id, $args ); } protected function render_content() { $values = json_decode( $this->value() ); $repeater_id = $this->id; $field_count = count( $values ); ?> label ); ?> description ) { ?> description ); ?> link(); ?> class="mt-repeater-collector" value="value() ); ?>" /> fields; $values = json_decode( $this->value() ); if ( is_array( $values ) ) { foreach( $values as $value ) { ?>
  • sophia_after_dark_box_label ); ?>

    $field ) { $class = isset( $field['class'] ) ? $field['class'] : ''; ?>
    $key ) ? $value->$key : ''; $default = isset( $field['default'] ) ? $field['default'] : ''; switch ( $field['type'] ) { /** * Text field */ case 'text': echo ''; break; /** * Textarea field */ case 'textarea': echo ''; break; /** * URL field */ case 'url': echo ''; break; /** * Icon field */ case 'icon': $sophia_after_dark_font_awesome_icon_array = sophia_after_dark_font_awesome_icon_array(); echo '
      '; foreach ( $sophia_after_dark_font_awesome_icon_array as $sophia_after_dark_font_awesome_icon ) { $icon_class = $new_value == $sophia_after_dark_font_awesome_icon ? 'icon-active' : ''; echo '
    • '; } echo '
    '; break; /** * Social Icon field */ case 'social_icon': $sophia_after_dark_font_awesome_social_icon_array = sophia_after_dark_font_awesome_social_icon_array(); echo '
      '; foreach ( $sophia_after_dark_font_awesome_social_icon_array as $sophia_after_dark_font_awesome_icon ) { $icon_class = $new_value == $sophia_after_dark_font_awesome_icon ? 'icon-active' : ''; echo '
    • '; } echo '
    '; break; /** * Select field */ case 'select': $options = $field['options']; echo ''; break; /** * Dropdown field */ case 'dropdown_pages': $show_option_none = esc_html__( '— Select a page —', 'sophia-after-dark' ); $select_field ='data-default="'.esc_attr( $default ).'" data-name="'.esc_attr( $key ).'"'; $option_none_value = ''; $dropdown = wp_dropdown_pages( array( 'name' => esc_attr( $key ), 'echo' => '', 'show_option_none' => esc_html( $show_option_none ), 'option_none_value' => esc_attr( $option_none_value ), 'selected' => esc_attr( $new_value ) ) ); if ( empty( $dropdown ) ) { $dropdown = sprintf( ''; } // Hackily add in the data link parameter. $dropdown = str_replace( '
    '; esc_html_e( 'No image selected', 'sophia-after-dark' ); echo '
    '; break; default: break; } ?>