Skip to content

Instantly share code, notes, and snippets.

@TANVIRFAZLEY
Created March 22, 2020 00:48
Show Gist options
  • Save TANVIRFAZLEY/11aa7c42a2ce4163df417b4876600f79 to your computer and use it in GitHub Desktop.
Save TANVIRFAZLEY/11aa7c42a2ce4163df417b4876600f79 to your computer and use it in GitHub Desktop.
repeater control for elementor
<?php
$this->add_control( 'testimonial_items', [
'label' => esc_html__( 'Testimonial Item', 'appside-master' ),
'type' => Controls_Manager::REPEATER,
'default' => [
[
'designation' => esc_html__( 'Technician', 'appside-master' ),
],
],
'fields' => [
[
'name' => 'designation',
'label' => esc_html__( 'Designation', 'appside-master' ),
'type' => Controls_Manager::TEXT,
'description' => esc_html__( 'enter designation', 'appside-master' ),
'default' => esc_html__( 'CEO, Appside', 'appside-master' )
],
[
'name' => 'ratings',
'label' => esc_html__( 'Ratings Show/Hide', 'appside-master' ),
'type' => Controls_Manager::SWITCHER,
'description' => esc_html__( 'show/hide ratings', 'appside-master' ),
],
[
'name' => 'ratings_count',
'label' => esc_html__( 'Ratings', 'appside-master' ),
'type' => Controls_Manager::SELECT,
'options' => [
'1' => esc_html__('1 star' ,'appside-master'),
'2' => esc_html__('2 star' ,'appside-master'),
'3' => esc_html__('3 star' ,'appside-master'),
'4' => esc_html__('4 star' ,'appside-master'),
'5' => esc_html__('5 star' ,'appside-master'),
],
'description' => esc_html__( 'set ratings', 'appside-master' ),
'condition' => [ 'ratings' => 'yes' ]
],
],
'title_field' => '{{name}}'
] );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment