add_field_label = esc_html__( 'Add new field', 'big-store' );
if ( ! empty( $args['add_field_label'] ) ) {
$this->add_field_label = $args['add_field_label'];
}
$this->boxtitle = esc_html__( 'Customizer Repeater', 'big-store' );
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'];
}
//logo image
if ( ! empty( $args['customizer_repeater_logo_image_control'] ) ) {
$this->customizer_repeater_logo_image_control = $args['customizer_repeater_logo_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_price_control'] ) ) {
$this->customizer_repeater_price_control = $args['customizer_repeater_price_control'];
}
if ( ! empty( $args['customizer_repeater_number_control'] ) ) {
$this->customizer_repeater_number_control = $args['customizer_repeater_number_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/repeater/icon-picker/icons.php' ) ) {
$this->customizer_icon_container = '/customizer/repeater/icon-picker/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() . '/third-party/fonts/font-awesome/css/font-awesome.css', array(), '1.0.0' );
wp_enqueue_style( 'open_customizer-repeater-admin-stylesheet', get_template_directory_uri() . '/customizer/repeater/style.css', array(), '1.0.0' );
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'big_store_customizer-repeater-script', get_template_directory_uri() . '/customizer/repeater/script.js', array( 'jquery', 'jquery-ui-draggable', 'wp-color-picker' ), '1.0.0', true );
wp_enqueue_script( 'big_store_customizer-repeater-fontawesome-iconpicker', get_template_directory_uri() . '/customizer/repeater/icon-picker/icon-picker.js', array( 'jquery' ), '1.0.0', true );
wp_enqueue_style( 'open_customizer-repeater-fontawesome-iconpicker-script', get_template_directory_uri() . '/customizer/repeater/icon-picker/icon-picker.css', array(), '1.0.0' );
}
/**
* Render the control
*/
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() ); ?>"/>
add_field_label ); ?>
boxtitle ); ?>
id === 'open_features_content' ) {
$choice = 'customizer_repeater_icon';
}
$image_url = '';
$logo_image_url = '';
$icon_value = '';
$title = '';
$price = '';
$number = '';
$subtitle = '';
$text = '';
$text2 = '';
$link2 = '';
$link = '';
$shortcode = '';
$repeater = '';
$color = '';
$color2 = '';
if ( ! empty( $icon->id ) ) {
$id = $icon->id;
}
if ( ! empty( $icon->choice ) ) {
$choice = $icon->choice;
}
if ( ! empty( $icon->image_url ) ) {
$image_url = $icon->image_url;
}
if ( ! empty( $icon->logo_image_url ) ) {
$logo_image_url = $icon->logo_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->price ) ) {
$price = $icon->price;
}
if ( ! empty( $icon->number ) ) {
$number = $icon->number;
}
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_logo_image_control == true ) {
$this->logo_image_control( $logo_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', 'big-store' ), $this->id, 'customizer_repeater_color_control' ),
'class' => 'customizer-repeater-color-control',
'type' => apply_filters( 'open_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', 'big-store' ), $this->id, 'customizer_repeater_color2_control' ),
'class' => 'customizer-repeater-color2-control',
'type' => apply_filters( 'open_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', 'big-store' ), $this->id, 'customizer_repeater_title_control' ),
'class' => 'customizer-repeater-title-control',
'type' => apply_filters( 'open_repeater_input_types_filter', '', $this->id, 'customizer_repeater_title_control' ),
), $title
);
}
///////////// price///////////
if ( $this->customizer_repeater_price_control == true ) {
$this->input_control(
array(
'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Price', 'big-store' ), $this->id, 'customizer_repeater_price_control' ),
'class' => 'customizer-repeater-price-control',
'type' => apply_filters( 'open_repeater_input_types_filter', '', $this->id, 'customizer_repeater_price_control' ),
), $price
);
}
///////////// number///////////
if ( $this->customizer_repeater_number_control == true ) {
$this->input_control(
array(
'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Number', 'big-store' ), $this->id, 'customizer_repeater_number_control' ),
'class' => 'customizer-repeater-number-control',
'type' => apply_filters( 'open_repeater_input_types_filter', '', $this->id, 'customizer_repeater_number_control' ),
), $number
);
}
if ( $this->customizer_repeater_subtitle_control == true ) {
$this->input_control(
array(
'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Subtitle', 'big-store' ), $this->id, 'customizer_repeater_subtitle_control' ),
'class' => 'customizer-repeater-subtitle-control',
'type' => apply_filters( 'open_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', 'big-store' ), $this->id, 'customizer_repeater_text_control' ),
'class' => 'customizer-repeater-text-control',
'type' => apply_filters( 'open_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text_control' ),
), $text
);
}
if ( $this->customizer_repeater_link_control ) {
$this->input_control(
array(
'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Link', 'big-store' ), $this->id, 'customizer_repeater_link_control' ),
'class' => 'customizer-repeater-link-control',
'sanitize_callback' => 'esc_url_raw',
'type' => apply_filters( 'open_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__( 'Button Text', 'big-store' ), $this->id, 'customizer_repeater_text2_control' ),
'class' => 'customizer-repeater-text2-control',
'type' => apply_filters( 'open_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', 'big-store' ), $this->id, 'customizer_repeater_link2_control' ),
'class' => 'customizer-repeater-link2-control',
'sanitize_callback' => 'esc_url_raw',
'type' => apply_filters( 'open_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', 'big-store' ), $this->id, 'customizer_repeater_shortcode_control' ),
'class' => 'customizer-repeater-shortcode-control',
'type' => apply_filters( 'open_repeater_input_types_filter', '', $this->id, 'customizer_repeater_shortcode_control' ),
), $shortcode
);
}
if ( $this->customizer_repeater_repeater_control == true ) {
$this->repeater_control( $repeater );
}
echo ' ';
echo '';
esc_html_e( 'Delete field', 'big-store' );
?>
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_logo_image_control == true ) {
$this->logo_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', 'big-store' ), $this->id, 'customizer_repeater_color_control' ),
'class' => 'customizer-repeater-color-control',
'type' => apply_filters( 'open_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', 'big-store' ), $this->id, 'customizer_repeater_color2_control' ),
'class' => 'customizer-repeater-color2-control',
'type' => apply_filters( 'open_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', 'big-store' ), $this->id, 'customizer_repeater_title_control' ),
'class' => 'customizer-repeater-title-control',
'type' => apply_filters( 'open_repeater_input_types_filter', '', $this->id, 'customizer_repeater_title_control' ),
)
);
}
//price control//////////
if ( $this->customizer_repeater_price_control == true ) {
$this->input_control(
array(
'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Price', 'big-store' ), $this->id, 'customizer_repeater_price_control' ),
'class' => 'customizer-repeater-price-control',
'type' => apply_filters( 'open_repeater_input_types_filter', '', $this->id, 'customizer_repeater_price_control' ),
)
);
}
//number control//////////
if ( $this->customizer_repeater_number_control == true ) {
$this->input_control(
array(
'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Number', 'big-store' ), $this->id, 'customizer_repeater_number_control' ),
'class' => 'customizer-repeater-number-control',
'type' => apply_filters( 'open_repeater_input_types_filter', '', $this->id, 'customizer_repeater_number_control' ),
)
);
}
if ( $this->customizer_repeater_subtitle_control == true ) {
$this->input_control(
array(
'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Subtitle', 'big-store' ), $this->id, 'customizer_repeater_subtitle_control' ),
'class' => 'customizer-repeater-subtitle-control',
'type' => apply_filters( 'open_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', 'big-store' ), $this->id, 'customizer_repeater_text_control' ),
'class' => 'customizer-repeater-text-control',
'type' => apply_filters( 'open_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text_control' ),
)
);
}
if ( $this->customizer_repeater_link_control == true ) {
$this->input_control(
array(
'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Link', 'big-store' ), $this->id, 'customizer_repeater_link_control' ),
'class' => 'customizer-repeater-link-control',
'type' => apply_filters( 'open_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__( 'Button Text', 'big-store' ), $this->id, 'customizer_repeater_text2_control' ),
'class' => 'customizer-repeater-text2-control',
'type' => apply_filters( 'open_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', 'big-store' ), $this->id, 'customizer_repeater_link2_control' ),
'class' => 'customizer-repeater-link2-control',
'type' => apply_filters( 'open_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', 'big-store' ), $this->id, 'customizer_repeater_shortcode_control' ),
'class' => 'customizer-repeater-shortcode-control',
'type' => apply_filters( 'open_repeater_input_types_filter', '', $this->id, 'customizer_repeater_shortcode_control' ),
)
);
}
if ( $this->customizer_repeater_repeater_control == true ) {
$this->repeater_control();
}
?>
id === 'open_features_content' && $options['choice'] !== 'customizer_repeater_icon' ) {
$style_to_add = 'display:none';
}
?>
>
>
>
customizer_icon_container ); ?>
id === 'open_features_content' && empty( $show ) ) ) {
echo 'style="display:none;"'; }
?>
>
id === 'open_features_content' && empty( $show ) ) ) {
echo 'style="display:none;"'; }
?>
>
>
>
>
>
';
echo sprintf(
/* translators: Fontawesome link with full list of icons available */
esc_html__( 'Note: Some icons may not be displayed here. You can see the full list of icons at Fontawesome website .', 'big-store' )
);
echo '';
if ( ! empty( $value ) ) {
$social_repeater = json_decode( html_entity_decode( $value ), true );
}
if ( ( count( $social_repeater ) == 1 && '' === $social_repeater[0] ) || empty( $social_repeater ) ) {
?>
';
echo '
';
echo ' ';
echo ' ';
echo '
';
get_template_part( $this->customizer_icon_container );
echo '
';
echo '
';
echo '
' . esc_html__( 'Remove Icon', 'big-store' ) . ' ';
echo '
';
}
?>