add_field_label = esc_html__( 'Add new field', '99fy-pro' ); if ( ! empty( $args['add_field_label'] ) ) { $this->add_field_label = $args['add_field_label']; } $this->boxtitle = esc_html__( 'Customizer Repeater', '99fy-pro' ); if ( ! empty ( $args['item_name'] ) ) { $this->boxtitle = $args['item_name']; } elseif ( ! empty( $this->label ) ) { $this->boxtitle = $this->label; } 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_title_control'] ) ) { $this->customizer_repeater_title_control = $args['customizer_repeater_title_control']; } if ( ! empty( $args['customizer_repeater_link_control'] ) ) { $this->customizer_repeater_link_control = $args['customizer_repeater_link_control']; } if ( ! empty( $id ) ) { $this->id = $id; } $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( 'nnprofy-fonticonpicker', NNFY_ADMIN_ASSETS . 'css/fonticonpicker.css', array(), NNFY_VERSION ); wp_enqueue_style( 'font-awesome-min', NNFY_ADMIN_ASSETS . 'css/font-awesome.min.css', array(), NNFY_VERSION ); wp_enqueue_style( 'nnprofy-customizer-repeater-control', NNFY_ADMIN_ASSETS . 'css/customizer-repeater-control.css', array(), NNFY_VERSION ); wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'nnprofy-fonticonpicker', NNFY_ADMIN_ASSETS . 'js/fonticonpicker.js', array( 'jquery' ), NNFY_VERSION, true ); wp_enqueue_script( 'nnprofy-customizer-repeater-control', NNFY_ADMIN_ASSETS . 'js/customizer-repeater-control.js', array('jquery', 'jquery-ui-draggable', 'wp-color-picker' ), NNFY_VERSION, true ); } 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 ); ?>
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 ) ) { 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->title ) ) { $title = $icon->title; } if ( ! empty( $icon->link ) ){ $link = $icon->link; } 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_title_control==true){ $this->input_control(array( 'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Title','99fy-pro' ), $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_link_control){ $this->input_control(array( 'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Link','99fy-pro' ), $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); } ?>
title ) ) { echo esc_html( $icon->title ); }else{ echo esc_html( $this->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_title_control == true ) { $this->input_control( array( 'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Title','99fy-pro' ), $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_link_control == true ) { $this->input_control( array( 'label' => apply_filters('repeater_input_labels_filter', esc_html__( 'Link','99fy-pro' ), $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' ), ) ); } ?>
>
>
>
>