add_field_label = esc_html__( 'Add new field', 'avantex' ); if ( ! empty( $args['add_field_label'] ) ) { $this->add_field_label = $args['add_field_label']; } $this->boxtitle = esc_html__( 'Customizer Repeater', 'avantex' ); if ( ! empty( $args['item_name'] ) ) { $this->boxtitle = $args['item_name']; } elseif ( ! empty( $this->label ) ) { $this->boxtitle = $this->label; } $this->boxdesc = esc_html__( '', 'avantex' ); if ( ! empty( $args['box_description'] ) ) { $this->boxdesc = $args['box_description']; } if ( ! empty( $args['customizer_repeater_image_control'] ) ) { $this->customizer_repeater_image_control = $args['customizer_repeater_image_control']; } if ( ! empty( $args['customizer_repeater_icon_control'] ) ) { $this->customizer_repeater_icon_control = $args['customizer_repeater_icon_control']; } if ( ! empty( $args['customizer_repeater_color_control'] ) ) { $this->customizer_repeater_color_control = $args['customizer_repeater_color_control']; } if ( ! empty( $args['customizer_repeater_color2_control'] ) ) { $this->customizer_repeater_color2_control = $args['customizer_repeater_color2_control']; } if ( ! empty( $args['customizer_repeater_title_control'] ) ) { $this->customizer_repeater_title_control = $args['customizer_repeater_title_control']; } if ( ! empty( $args['customizer_repeater_btntitle_control'] ) ) { $this->customizer_repeater_btntitle_control = $args['customizer_repeater_btntitle_control']; } if ( ! empty( $args['customizer_repeater_subtitle_control'] ) ) { $this->customizer_repeater_subtitle_control = $args['customizer_repeater_subtitle_control']; } if ( ! empty( $args['customizer_repeater_text_control'] ) ) { $this->customizer_repeater_text_control = $args['customizer_repeater_text_control']; } if ( ! empty( $args['customizer_repeater_link_control'] ) ) { $this->customizer_repeater_link_control = $args['customizer_repeater_link_control']; } if ( ! empty( $args['customizer_repeater_text2_control'] ) ) { $this->customizer_repeater_text2_control = $args['customizer_repeater_text2_control']; } if ( ! empty( $args['customizer_repeater_link2_control'] ) ) { $this->customizer_repeater_link2_control = $args['customizer_repeater_link2_control']; } if ( ! empty( $args['customizer_repeater_shortcode_control'] ) ) { $this->customizer_repeater_shortcode_control = $args['customizer_repeater_shortcode_control']; } if ( ! empty( $args['customizer_repeater_repeater_control'] ) ) { $this->customizer_repeater_repeater_control = $args['customizer_repeater_repeater_control']; } if ( ! empty( $id ) ) { $this->id = $id; } if ( file_exists( get_template_directory() . '/customizer-controls-master/customizer-repeater/inc/icons.php' ) ) { $this->customizer_icon_container = '/customizer-controls-master/customizer-repeater/inc/icons'; } $allowed_array1 = wp_kses_allowed_html( 'post' ); $allowed_array2 = array( 'input' => array( 'type' => array(), 'class' => array(), 'placeholder' => array(), ), ); $this->allowed_html = array_merge( $allowed_array1, $allowed_array2 ); } /** * Enqueue resources for the control */ public function enqueue() { wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/customizer-controls-master/customizer-repeater/fontawesome/css/fontawesome.min.css', array(), CUSTOMIZER_REPEATER_VERSION ); wp_enqueue_style( 'font-awesome-brands', get_template_directory_uri() . '/customizer-controls-master/customizer-repeater/fontawesome/css/brands.css', array(), CUSTOMIZER_REPEATER_VERSION ); wp_enqueue_style( 'font-awesome-solids', get_template_directory_uri() . '/customizer-controls-master/customizer-repeater/fontawesome/css/solid.css', array(), CUSTOMIZER_REPEATER_VERSION ); wp_enqueue_style( 'font-awesome-v5', get_template_directory_uri() . '/customizer-controls-master/customizer-repeater/fontawesome/css/v5-font-face.css', array(), CUSTOMIZER_REPEATER_VERSION ); wp_enqueue_style( 'font-awesome-v4', get_template_directory_uri() . '/customizer-controls-master/customizer-repeater/fontawesome/css/v4-font-face.css', array(), CUSTOMIZER_REPEATER_VERSION ); wp_enqueue_style( 'customizer-repeater-admin-stylesheet', get_template_directory_uri() . '/customizer-controls-master/customizer-repeater/css/admin-style.css', array(), CUSTOMIZER_REPEATER_VERSION ); wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'customizer-repeater-script', get_template_directory_uri() . '/customizer-controls-master/customizer-repeater/js/customizer_repeater.js', array( 'jquery', 'jquery-ui-draggable', 'wp-color-picker' ), CUSTOMIZER_REPEATER_VERSION, true ); wp_enqueue_script( 'customizer-repeater-fontawesome-iconpicker', get_template_directory_uri() . '/customizer-controls-master/customizer-repeater/js/fontawesome-iconpicker.min.js', array( 'jquery' ), CUSTOMIZER_REPEATER_VERSION, true ); wp_enqueue_style( 'customizer-repeater-fontawesome-iconpicker-script', get_template_directory_uri() . '/customizer-controls-master/customizer-repeater/css/fontawesome-iconpicker.min.css', array(), CUSTOMIZER_REPEATER_VERSION ); } /** * Render display function. */ public function render_content() { /*Get default options*/ $this_default = json_decode( $this->setting->default ); /*Get values (json format)*/ $values = $this->value(); /*Decode values*/ $json = json_decode( $values ); if ( ! is_array( $json ) ) { $json = array( $values ); } ?> label ); ?> boxdesc ); ?>
iterate_array( $this_default ); ?> link() ); ?> class="customizer-repeater-colector" value=""/> iterate_array(); ?> link() ); ?> class="customizer-repeater-colector"/> iterate_array( $json ); ?> link() ); ?> class="customizer-repeater-colector" value="value() ); ?>"/>
title ) ) { if ( $icon->title != '' ) { echo esc_html( $icon->title ); } else { echo esc_html( $this->boxtitle );} } ?>
id ) ) { $id = $icon->id; } if ( ! empty( $icon->choice ) ) { $choice = $icon->choice; } if ( ! empty( $icon->image_url ) ) { $image_url = $icon->image_url; } if ( ! empty( $icon->icon_value ) ) { $icon_value = $icon->icon_value; } if ( ! empty( $icon->color ) ) { $color = $icon->color; } if ( ! empty( $icon->color2 ) ) { $color2 = $icon->color2; } if ( ! empty( $icon->title ) ) { $title = $icon->title; } if ( ! empty( $icon->btntitle ) ) { $btntitle = $icon->btntitle; } if ( ! empty( $icon->subtitle ) ) { $subtitle = $icon->subtitle; } if ( ! empty( $icon->text ) ) { $text = $icon->text; } if ( ! empty( $icon->link ) ) { $link = $icon->link; } if ( ! empty( $icon->text2 ) ) { $text2 = $icon->text2; } if ( ! empty( $icon->link2 ) ) { $link2 = $icon->link2; } if ( ! empty( $icon->shortcode ) ) { $shortcode = $icon->shortcode; } if ( ! empty( $icon->social_repeater ) ) { $repeater = $icon->social_repeater; } if ( $this->customizer_repeater_image_control == true && $this->customizer_repeater_icon_control == true ) { $this->icon_type_choice( $choice ); } if ( $this->customizer_repeater_image_control == true ) { $this->image_control( $image_url, $choice ); } if ( $this->customizer_repeater_icon_control == true ) { $this->icon_picker_control( $icon_value, $choice ); } if ( $this->customizer_repeater_color_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Color', 'avantex' ), $this->id, 'customizer_repeater_color_control' ), 'class' => 'customizer-repeater-color-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color_control' ), 'sanitize_callback' => 'sanitize_hex_color', 'choice' => $choice, ), $color ); } if ( $this->customizer_repeater_color2_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Color', 'avantex' ), $this->id, 'customizer_repeater_color2_control' ), 'class' => 'customizer-repeater-color2-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color2_control' ), 'sanitize_callback' => 'sanitize_hex_color', ), $color2 ); } if ( $this->customizer_repeater_title_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Title', 'avantex' ), $this->id, 'customizer_repeater_title_control' ), 'class' => 'customizer-repeater-title-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', '', $this->id, 'customizer_repeater_title_control' ), ), $title ); } if ( $this->customizer_repeater_subtitle_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Subtitle', 'avantex' ), $this->id, 'customizer_repeater_subtitle_control' ), 'class' => 'customizer-repeater-subtitle-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle_control' ), ), $subtitle ); } if ( $this->customizer_repeater_text_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Text', 'avantex' ), $this->id, 'customizer_repeater_text_control' ), 'class' => 'customizer-repeater-text-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text_control' ), ), $text ); } if ( $this->customizer_repeater_btntitle_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Button Text', 'avantex' ), $this->id, 'customizer_repeater_btntitle_control' ), 'class' => 'customizer-repeater-btntitle-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', '', $this->id, 'customizer_repeater_btntitle_control' ), ), $btntitle ); } if ( $this->customizer_repeater_link_control ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Link', 'avantex' ), $this->id, 'customizer_repeater_link_control' ), 'class' => 'customizer-repeater-link-control', 'sanitize_callback' => 'esc_url_raw', 'type' => apply_filters( 'customizer_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link_control' ), ), $link ); } if ( $this->customizer_repeater_text2_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Text', 'avantex' ), $this->id, 'customizer_repeater_text2_control' ), 'class' => 'customizer-repeater-text2-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text2_control' ), ), $text2 ); } if ( $this->customizer_repeater_link2_control ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Link', 'avantex' ), $this->id, 'customizer_repeater_link2_control' ), 'class' => 'customizer-repeater-link2-control', 'sanitize_callback' => 'esc_url_raw', 'type' => apply_filters( 'customizer_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link2_control' ), ), $link2 ); } if ( $this->customizer_repeater_shortcode_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Shortcode', 'avantex' ), $this->id, 'customizer_repeater_shortcode_control' ), 'class' => 'customizer-repeater-shortcode-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', '', $this->id, 'customizer_repeater_shortcode_control' ), ), $shortcode ); } if ( $this->customizer_repeater_repeater_control == true ) { $this->repeater_control( $repeater ); } ?>
boxtitle ); ?>
customizer_repeater_image_control == true && $this->customizer_repeater_icon_control == true ) { $this->icon_type_choice(); } if ( $this->customizer_repeater_image_control == true ) { $this->image_control(); } if ( $this->customizer_repeater_icon_control == true ) { $this->icon_picker_control(); } if ( $this->customizer_repeater_color_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Color', 'avantex' ), $this->id, 'customizer_repeater_color_control' ), 'class' => 'customizer-repeater-color-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color_control' ), 'sanitize_callback' => 'sanitize_hex_color', ) ); } if ( $this->customizer_repeater_color2_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Color', 'avantex' ), $this->id, 'customizer_repeater_color2_control' ), 'class' => 'customizer-repeater-color2-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color2_control' ), 'sanitize_callback' => 'sanitize_hex_color', ) ); } if ( $this->customizer_repeater_title_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Title', 'avantex' ), $this->id, 'customizer_repeater_title_control' ), 'class' => 'customizer-repeater-title-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', '', $this->id, 'customizer_repeater_title_control' ), ) ); } if ( $this->customizer_repeater_subtitle_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Subtitle', 'avantex' ), $this->id, 'customizer_repeater_subtitle_control' ), 'class' => 'customizer-repeater-subtitle-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle_control' ), ) ); } if ( $this->customizer_repeater_text_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Text', 'avantex' ), $this->id, 'customizer_repeater_text_control' ), 'class' => 'customizer-repeater-text-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text_control' ), ) ); } if ( $this->customizer_repeater_btntitle_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Button Text', 'avantex' ), $this->id, 'customizer_repeater_btntitle_control' ), 'class' => 'customizer-repeater-btntitle-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', '', $this->id, 'customizer_repeater_btntitle_control' ), ) ); } if ( $this->customizer_repeater_link_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Link', 'avantex' ), $this->id, 'customizer_repeater_link_control' ), 'class' => 'customizer-repeater-link-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link_control' ), ) ); } if ( $this->customizer_repeater_text2_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Text', 'avantex' ), $this->id, 'customizer_repeater_text2_control' ), 'class' => 'customizer-repeater-text2-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text2_control' ), ) ); } if ( $this->customizer_repeater_link2_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Link', 'avantex' ), $this->id, 'customizer_repeater_link2_control' ), 'class' => 'customizer-repeater-link2-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link2_control' ), ) ); } if ( $this->customizer_repeater_shortcode_control == true ) { $this->input_control( array( 'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Shortcode', 'avantex' ), $this->id, 'customizer_repeater_shortcode_control' ), 'class' => 'customizer-repeater-shortcode-control', 'type' => apply_filters( 'customizer_repeater_input_types_filter', '', $this->id, 'customizer_repeater_shortcode_control' ), ) ); } if ( $this->customizer_repeater_repeater_control == true ) { $this->repeater_control(); } ?>
>
>
> %s', esc_html__( 'http://fontawesome.io/icons/', 'avantex' ) ) ); ?>
customizer_icon_container ); ?>
>
'; echo sprintf( /* translators: %1$s is Fontawesome link. */ esc_html__( 'Note: Some icons may not be displayed here. You can see the full list of icons at %1$s.', 'avantex' ), sprintf( '%s', esc_html__( 'http://fontawesome.io/icons/', 'avantex' ) ) ); echo ''; if ( ! empty( $value ) ) { $social_repeater = json_decode( html_entity_decode( $value ), true ); } if ( ( count( $social_repeater ) == 1 && '' === $social_repeater[0] ) || empty( $social_repeater ) ) { ?>
customizer_icon_container ); ?>
customizer_icon_container ); ?>