salmancreation

testimonial widgets (travil theme) - fixed esc html issues

Jun 11th, 2025
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 31.80 KB | None | 0 0
  1. <?php
  2. use \Elementor\Widget_Base;
  3. use \Elementor\Controls_Manager;
  4. use \Elementor\Group_Control_Typography;
  5. use \Elementor\Utils;
  6. use \Elementor\Repeater;
  7. use \Elementor\Group_Control_Border;
  8. /**
  9.  *
  10.  * Testimonials Widget .
  11.  *
  12.  */
  13. class Travil_Testimonials extends Widget_Base {
  14.  
  15.     public function get_name() {
  16.         return 'traviltestimonials';
  17.     }
  18.  
  19.     public function get_title() {
  20.         return __( 'Travil Testimonials', 'travil' );
  21.     }
  22.  
  23.     public function get_icon() {
  24.         return 'vt-icon';
  25.     }
  26.  
  27.     public function get_categories() {
  28.         return [ 'travil' ];
  29.     }
  30.  
  31.     protected function register_controls() {
  32.  
  33.         $this->start_controls_section(
  34.             'features_section',
  35.             [
  36.                 'label'     => __( 'Testimonials', 'travil' ),
  37.                 'tab'       => Controls_Manager::TAB_CONTENT,
  38.             ]
  39.         );
  40.         $this->add_control(
  41.             'testimonials_style',
  42.             [
  43.                 'label'         => __( 'Testimonial Style', 'travil' ),
  44.                 'type'          => Controls_Manager::SELECT,
  45.                 'default'       => '1',
  46.                 'options'       => [
  47.                     '1'         => __( 'Style One', 'travil' ),
  48.                     '2'         => __( 'Style Two', 'travil' ),
  49.                     '3'         => __( 'Style Three', 'travil' ),
  50.                 ],
  51.             ]
  52.         );
  53.  
  54.         $this->add_control(
  55.             'enable_heading',
  56.             [
  57.                 'label'         => __( 'Show SSection Header?', 'travil' ),
  58.                 'type'          => Controls_Manager::SWITCHER,
  59.                 'label_on'      => __( 'Show', 'travil' ),
  60.                 'label_off'     => __( 'Hide', 'travil' ),
  61.                 'return_value'  => 'yes',
  62.                 'default'       => 'yes',
  63.             ]
  64.         );
  65.         $this->add_control(
  66.             'subtitle',
  67.             [
  68.                 'label'     => __( 'Subtitle', 'travil' ),
  69.                 'type'      => Controls_Manager::TEXTAREA,
  70.                 'rows'      => 2,
  71.                 'default'   => __( 'Grow business by', 'travil' ),
  72.                 'condition'     => [ 'enable_heading' => 'yes'  ],
  73.             ]
  74.         );
  75.         $this->add_control(
  76.             'title',
  77.             [
  78.                 'label'     => __( 'Title', 'travil' ),
  79.                 'type'      => Controls_Manager::TEXTAREA,
  80.                 'rows'      => 2,
  81.                 'default'   => __( 'Award winning digital marketing agency ', 'travil' ),
  82.                 'condition'     => [ 'enable_heading' => 'yes'  ],
  83.             ]
  84.         );
  85.         $this->add_control(
  86.             'desc',
  87.             [
  88.                 'label'     => __( 'Description', 'travil' ),
  89.                 'type'      => Controls_Manager::TEXTAREA,
  90.                 'rows'      => 3,
  91.                 'default'   => __( 'Award winning digital marketing agency ', 'travil' ),
  92.                 'condition'     => [ 'enable_heading' => 'yes'  ],
  93.             ]
  94.         );
  95.         $this->add_control(
  96.             'shape',
  97.             [
  98.                 'label'         => __( 'Ratting Image', 'travil' ),
  99.                 'type'          => Controls_Manager::MEDIA,
  100.                 'dynamic'       => [
  101.                     'active'        => true,
  102.                 ],
  103.                 'default'       => [
  104.                     'url'           => Utils::get_placeholder_image_src(),
  105.                 ],
  106.                 'condition' => [ 'testimonials_style' => ['2'],'enable_heading' => 'yes' ],
  107.             ]
  108.         );
  109.         $this->add_control(
  110.             'ratting_text',
  111.             [
  112.                 'label'     => __( 'Ratting Text', 'travil' ),
  113.                 'type'      => Controls_Manager::TEXTAREA,
  114.                 'rows'      => 4,
  115.                 'default'   => __( 'Award winning digital marketing agency ', 'travil' ),
  116.                 'condition' => [ 'testimonials_style' => ['2'],'enable_heading' => 'yes' ],
  117.             ]
  118.         );
  119.         //----------------------------feddback repeter start--------------------------------//
  120.  
  121.         $repeater = new Repeater();
  122.  
  123.         $repeater->add_control(
  124.             'name', [
  125.                 'label'         => __( 'Name', 'travil' ),
  126.                 'type'          => Controls_Manager::TEXTAREA,
  127.                 'rows'          => 2,
  128.                 'default'       => __( 'Rubaida Kanom' , 'travil' ),
  129.                 'label_block'   => true,
  130.             ]
  131.         );
  132.        
  133.         $repeater->add_control(
  134.             'from', [
  135.                 'label'         => __( 'From', 'travil' ),
  136.                 'type'          => Controls_Manager::TEXTAREA,
  137.                 'rows'          => 2,
  138.                 'default'       => __( 'from New York, USA' , 'travil' ),
  139.                 'label_block'   => true,
  140.             ]
  141.         );
  142.         $repeater->add_control(
  143.             'feedback', [
  144.                 'label'         => __( 'Feedback', 'travil' ),
  145.                 'type'          => Controls_Manager::TEXTAREA,
  146.                 'default'       => __( 'Rubaida Kanom' , 'travil' ),
  147.                 'label_block'   => true,
  148.             ]
  149.         );
  150.         $repeater->add_control(
  151.             'client_rating',
  152.             [
  153.                 'label'     => __( 'Client Rating', 'travil' ),
  154.                 'type'      => Controls_Manager::SELECT,
  155.                 'default'   => '5',
  156.                 'options'   => [
  157.                     'one'       => __( 'One Star', 'travil' ),
  158.                     'two'       => __( 'Two Star', 'travil' ),
  159.                     'three'     => __( 'Three Star', 'travil' ),
  160.                     'four'      => __( 'Four Star', 'travil' ),
  161.                     'five'      => __( 'Five Star', 'travil' ),
  162.                 ],
  163.             ]
  164.         );
  165.         $repeater->add_control(
  166.             'img',
  167.             [
  168.                 'label'         => __( 'Image', 'travil' ),
  169.                 'type'          => Controls_Manager::MEDIA,
  170.                 'dynamic'       => [
  171.                     'active'        => true,
  172.                 ],
  173.                 'default'       => [
  174.                     'url'           => Utils::get_placeholder_image_src(),
  175.                 ],
  176.             ]
  177.         );
  178.         $this->add_control(
  179.             'slides',
  180.             [
  181.                 'label'         => __( 'Slides', 'travil' ),
  182.                 'type'          => Controls_Manager::REPEATER,
  183.                 'fields'        => $repeater->get_controls(),
  184.                 'default'       => [
  185.                     [
  186.                         'name'      => __( 'Rubaida Kanom', 'travil' ),
  187.                     ],
  188.                 ],
  189.                 'title_field'   => '{{{ name }}}',
  190.             ]
  191.         );
  192.  
  193.        
  194.         $this->add_control(
  195.             'quote',
  196.             [
  197.                 'label'         => __( 'Quote Image', 'travil' ),
  198.                 'type'          => Controls_Manager::MEDIA,
  199.                 'dynamic'       => [
  200.                     'active'        => true,
  201.                 ],
  202.                 'default'       => [
  203.                     'url'           => Utils::get_placeholder_image_src(),
  204.                 ],
  205.             ]
  206.         );
  207.  
  208.         $this->add_control(
  209.             'thumb',
  210.             [
  211.                 'label'         => __( 'Thumb Image', 'travil' ),
  212.                 'type'          => Controls_Manager::MEDIA,
  213.                 'dynamic'       => [
  214.                     'active'        => true,
  215.                 ],
  216.                 'default'       => [
  217.                     'url'           => Utils::get_placeholder_image_src(),
  218.                 ],
  219.                 'condition' => [ 'testimonials_style' => ['2'] ],
  220.             ]
  221.         );
  222.         $this->end_controls_section();
  223.  
  224.  
  225.  
  226.         //---------------------------headingggg---------------------------///
  227.  
  228.         //---------------------------------------Title Style---------------------------------------//
  229.  
  230.         $this->start_controls_section(
  231.             'title_style',
  232.             [
  233.                 'label'     => __( 'Section Title Style', 'travil' ),
  234.                 'tab'       => Controls_Manager::TAB_STYLE,
  235.                
  236.             ]
  237.         );
  238.         $this->add_control(
  239.             'title_color',
  240.             [
  241.                 'label'         => __( 'Title Color', 'travil' ),
  242.                 'type'          => Controls_Manager::COLOR,
  243.                 'selectors'     => [
  244.                     '{{WRAPPER}} .section-title h2' => 'color: {{VALUE}}',
  245.                 ],
  246.             ]
  247.         );
  248.         $this->add_group_control(
  249.             Group_Control_Typography::get_type(),
  250.             [
  251.                 'name'      => 'title_typography',
  252.                 'label'     => __( 'Title Typography', 'travil' ),
  253.                 'selector'  => '{{WRAPPER}} .section-title h2',
  254.             ]
  255.         );
  256.         $this->add_responsive_control(
  257.             'title_margin',
  258.             [
  259.                 'label'         => __( 'Title Margin', 'travil' ),
  260.                 'type'          => Controls_Manager::DIMENSIONS,
  261.                 'size_units'    => [ 'px', '%', 'em' ],
  262.                 'selectors'     => [
  263.                     '{{WRAPPER}} .section-title h2' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
  264.                 ]
  265.             ]
  266.         );
  267.  
  268.         $this->add_responsive_control(
  269.             'title_padding',
  270.             [
  271.                 'label'         => __( 'Title Padding', 'travil' ),
  272.                 'type'          => Controls_Manager::DIMENSIONS,
  273.                 'size_units'    => [ 'px', '%', 'em' ],
  274.                 'selectors'     => [
  275.                     '{{WRAPPER}} .section-title h2' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
  276.                 ]
  277.             ]
  278.         );
  279.         $this->end_controls_section();
  280.  
  281.         //---------------------------------------Title Style---------------------------------------//
  282.  
  283.         $this->start_controls_section(
  284.             'subtitle_style',
  285.             [
  286.                 'label'     => __( 'Section Subtitle Style', 'travil' ),
  287.                 'tab'       => Controls_Manager::TAB_STYLE,
  288.                
  289.             ]
  290.         );
  291.         $this->add_control(
  292.             'subtitle_color',
  293.             [
  294.                 'label'         => __( 'Color', 'travil' ),
  295.                 'type'          => Controls_Manager::COLOR,
  296.                 'selectors'     => [
  297.                     '{{WRAPPER}} .section-title span' => 'color: {{VALUE}}',
  298.                 ],
  299.             ]
  300.         );
  301.         $this->add_group_control(
  302.             Group_Control_Typography::get_type(),
  303.             [
  304.                 'name'      => 'subtitle_typography',
  305.                 'label'     => __( 'Typography', 'travil' ),
  306.                 'selector'  => '{{WRAPPER}} .section-title span',
  307.             ]
  308.         );
  309.         $this->add_responsive_control(
  310.             'subtitle_margin',
  311.             [
  312.                 'label'         => __( 'Margin', 'travil' ),
  313.                 'type'          => Controls_Manager::DIMENSIONS,
  314.                 'size_units'    => [ 'px', '%', 'em' ],
  315.                 'selectors'     => [
  316.                     '{{WRAPPER}} .section-title span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
  317.                 ]
  318.             ]
  319.         );
  320.  
  321.         $this->add_responsive_control(
  322.             'subtitle_padding',
  323.             [
  324.                 'label'         => __( 'Padding', 'travil' ),
  325.                 'type'          => Controls_Manager::DIMENSIONS,
  326.                 'size_units'    => [ 'px', '%', 'em' ],
  327.                 'selectors'     => [
  328.                     '{{WRAPPER}} .section-title span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
  329.                 ]
  330.             ]
  331.         );
  332.         $this->end_controls_section();
  333.  
  334.  
  335.         //---------------------------------------Desc Style---------------------------------------//
  336.  
  337.         $this->start_controls_section(
  338.             'desc_style',
  339.             [
  340.                 'label'     => __( 'Section Description Style', 'travil' ),
  341.                 'tab'       => Controls_Manager::TAB_STYLE,
  342.                
  343.             ]
  344.         );
  345.         $this->add_control(
  346.             'desc_color',
  347.             [
  348.                 'label'         => __( 'Color', 'travil' ),
  349.                 'type'          => Controls_Manager::COLOR,
  350.                 'selectors'     => [
  351.                     '{{WRAPPER}} .section-title p' => 'color: {{VALUE}}',
  352.                 ],
  353.             ]
  354.         );
  355.         $this->add_group_control(
  356.             Group_Control_Typography::get_type(),
  357.             [
  358.                 'name'      => 'desc_typography',
  359.                 'label'     => __( 'Typography', 'travil' ),
  360.                 'selector'  => '{{WRAPPER}} .section-title p',
  361.             ]
  362.         );
  363.         $this->add_responsive_control(
  364.             'desc_margin',
  365.             [
  366.                 'label'         => __( 'Margin', 'travil' ),
  367.                 'type'          => Controls_Manager::DIMENSIONS,
  368.                 'size_units'    => [ 'px', '%', 'em' ],
  369.                 'selectors'     => [
  370.                     '{{WRAPPER}} .section-title p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
  371.                 ]
  372.             ]
  373.         );
  374.  
  375.         $this->add_responsive_control(
  376.             'desc_padding',
  377.             [
  378.                 'label'         => __( 'Padding', 'travil' ),
  379.                 'type'          => Controls_Manager::DIMENSIONS,
  380.                 'size_units'    => [ 'px', '%', 'em' ],
  381.                 'selectors'     => [
  382.                     '{{WRAPPER}} .section-title p' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
  383.                 ]
  384.             ]
  385.         );
  386.         $this->end_controls_section();
  387.  
  388.        
  389.         /*-----------------------------------------Feedback styling------------------------------------*/
  390.  
  391.         $this->start_controls_section(
  392.             'overview_con_styling',
  393.             [
  394.                 'label'     => __( 'Testimonials Styling', 'travil' ),
  395.                 'tab'       => Controls_Manager::TAB_STYLE,
  396.             ]
  397.         );
  398.         $this->start_controls_tabs(
  399.             'style_tabs2'
  400.         );
  401.  
  402.  
  403.         $this->start_controls_tab(
  404.             'style_normal_tab2',
  405.             [
  406.                 'label' => esc_html__( 'Name', 'travil' ),
  407.             ]
  408.         );
  409.         $this->add_control(
  410.             'overview_title_color',
  411.             [
  412.                 'label'         => __( 'Color', 'travil' ),
  413.                 'type'          => Controls_Manager::COLOR,
  414.                 'selectors'     => [
  415.                     '{{WRAPPER}} h4'    => 'color: {{VALUE}}!important;',
  416.                 ],
  417.             ]
  418.         );
  419.         $this->add_group_control(
  420.         Group_Control_Typography::get_type(),
  421.             [
  422.                 'name'          => 'overview_title_typography',
  423.                 'label'         => __( 'Typography', 'travil' ),
  424.                 'selector'  => '{{WRAPPER}} h4',
  425.             ]
  426.         );
  427.  
  428.         $this->add_responsive_control(
  429.             'overview_title_margin',
  430.             [
  431.                 'label'         => __( 'Margin', 'travil' ),
  432.                 'type'          => Controls_Manager::DIMENSIONS,
  433.                 'size_units'    => [ 'px', '%', 'em' ],
  434.                 'selectors'     => [
  435.                     '{{WRAPPER}} h4' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
  436.                 ],
  437.             ]
  438.         );
  439.  
  440.         $this->add_responsive_control(
  441.             'overview_title_padding',
  442.             [
  443.                 'label'         => __( 'Padding', 'travil' ),
  444.                 'type'          => Controls_Manager::DIMENSIONS,
  445.                 'size_units'    => [ 'px', '%', 'em' ],
  446.                 'selectors'     => [
  447.                     '{{WRAPPER}} h4' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
  448.                 ],
  449.             ]
  450.         );
  451.         $this->end_controls_tab();
  452.  
  453.         //--------------------secound--------------------//
  454.  
  455.         $this->start_controls_tab(
  456.             'style_hover_tab2',
  457.             [
  458.                 'label' => esc_html__( 'From', 'travil' ),
  459.             ]
  460.         );
  461.         $this->add_control(
  462.             'overview_content_color',
  463.             [
  464.                 'label'         => __( 'Color', 'travil' ),
  465.                 'type'          => Controls_Manager::COLOR,
  466.                 'selectors'     => [
  467.                     '{{WRAPPER}} .from__class'  => 'color: {{VALUE}}!important;',
  468.                 ],
  469.             ]
  470.         );
  471.         $this->add_group_control(
  472.         Group_Control_Typography::get_type(),
  473.             [
  474.                 'name'          => 'overview_content_typography',
  475.                 'label'         => __( 'Typography', 'travil' ),
  476.                 'selector'  => '{{WRAPPER}} .from__class',
  477.             ]
  478.         );
  479.  
  480.         $this->add_responsive_control(
  481.             'overview_content_margin',
  482.             [
  483.                 'label'         => __( 'Margin', 'travil' ),
  484.                 'type'          => Controls_Manager::DIMENSIONS,
  485.                 'size_units'    => [ 'px', '%', 'em' ],
  486.                 'selectors'     => [
  487.                     '{{WRAPPER}} .from__class' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
  488.                 ],
  489.             ]
  490.         );
  491.  
  492.         $this->add_responsive_control(
  493.             'overview_content_padding',
  494.             [
  495.                 'label'         => __( 'Padding', 'travil' ),
  496.                 'type'          => Controls_Manager::DIMENSIONS,
  497.                 'size_units'    => [ 'px', '%', 'em' ],
  498.                 'selectors'     => [
  499.                     '{{WRAPPER}} .from__class' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
  500.                 ],
  501.             ]
  502.         );
  503.  
  504.         $this->end_controls_tab();
  505.  
  506.  
  507.         //--------------------three--------------------//
  508.  
  509.         $this->start_controls_tab(
  510.             'style_hover_tab3',
  511.             [
  512.                 'label' => esc_html__( 'Feedback', 'travil' ),
  513.             ]
  514.         );
  515.         $this->add_control(
  516.             'counter_color',
  517.             [
  518.                 'label'         => __( 'Color', 'travil' ),
  519.                 'type'          => Controls_Manager::COLOR,
  520.                 'selectors'     => [
  521.                     '{{WRAPPER}} h3'    => 'color: {{VALUE}}!important;',
  522.                 ],
  523.             ]
  524.         );
  525.         $this->add_group_control(
  526.         Group_Control_Typography::get_type(),
  527.             [
  528.                 'name'          => 'counter_typography',
  529.                 'label'         => __( 'Typography', 'travil' ),
  530.                 'selector'  => '{{WRAPPER}} h3',
  531.             ]
  532.         );
  533.  
  534.         $this->add_responsive_control(
  535.             'counter_margin',
  536.             [
  537.                 'label'         => __( 'Margin', 'travil' ),
  538.                 'type'          => Controls_Manager::DIMENSIONS,
  539.                 'size_units'    => [ 'px', '%', 'em' ],
  540.                 'selectors'     => [
  541.                     '{{WRAPPER}} h3' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
  542.                 ],
  543.             ]
  544.         );
  545.  
  546.         $this->add_responsive_control(
  547.             'counter_padding',
  548.             [
  549.                 'label'         => __( 'Padding', 'travil' ),
  550.                 'type'          => Controls_Manager::DIMENSIONS,
  551.                 'size_units'    => [ 'px', '%', 'em' ],
  552.                 'selectors'     => [
  553.                     '{{WRAPPER}} h3' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
  554.                 ],
  555.             ]
  556.         );
  557.  
  558.  
  559.  
  560.         $this->end_controls_tab();
  561.  
  562.         $this->end_controls_tabs();
  563.         $this->end_controls_section();
  564.     }
  565.  
  566.     protected function render() {
  567.  
  568.         $settings = $this->get_settings_for_display();
  569.  
  570.         echo '<!------------------------------- Testimonials Area start ------------------------------->';
  571.             if($settings['testimonials_style'] == 1) {
  572.  
  573.                 echo '<section class="testimonial-section-4">';
  574.                     echo '<div class="container">';
  575.                         if ( $settings['enable_heading'] == 'yes' ){
  576.                             echo '<div class="section-title-area lg-center">';
  577.                                 echo '<div class="section-title">';
  578.                                     echo '<span class="wow fadeInUp">' . esc_html( $settings['subtitle'] ) . '</span>';
  579.                                     echo '<h2 class="wow fadeInUp" data-wow-delay=".3s">' . wp_kses_post( $settings['title'] ) . '</h2>';
  580.                                 echo '</div>';
  581.                                 echo '<p class="wow fadeInUp" data-wow-delay=".5">' . wp_kses_post( $settings['desc'] ) . '</p>';
  582.                             echo '</div>';
  583.                         }
  584.                         echo '<div class="swiper testimonial-slider-4">';
  585.                             echo '<div class="swiper-wrapper">';
  586.  
  587.                                foreach( $settings['slides'] as $single_data ){
  588.                                    echo ' <div class="swiper-slide">';
  589.                                         echo '<div class="testimonial-box-items-4">';
  590.                                             if( ! empty( $single_data['img']['url'] ) ){
  591.                                                 echo '<div class="testi-img">';
  592.                                                     echo travil_img_tag( array(
  593.                                                         'url'   => esc_url( $single_data['img']['url'] ),
  594.                                                     ) );
  595.                                                 echo '</div>';
  596.                                             }
  597.                                             echo '<div class="star">';
  598.                                                 if( $single_data['client_rating'] == 'one' ){
  599.                                                     echo '<i class="fas fa-star"></i>';
  600.                                                     echo '<i class="far fa-star"></i>';
  601.                                                     echo '<i class="far fa-star"></i>';
  602.                                                     echo '<i class="far fa-star"></i>';
  603.                                                     echo '<i class="far fa-star"></i>';
  604.                                                 }elseif( $single_data['client_rating'] == 'two' ){
  605.                                                     echo '<i class="fas fa-star"></i>';
  606.                                                     echo '<i class="fas fa-star"></i>';
  607.                                                     echo '<i class="far fa-star"></i>';
  608.                                                     echo '<i class="far fa-star"></i>';
  609.                                                     echo '<i class="far fa-star"></i>';
  610.                                                 }elseif( $single_data['client_rating'] == 'three' ){
  611.                                                     echo '<i class="fas fa-star"></i>';
  612.                                                     echo '<i class="fas fa-star"></i>';
  613.                                                     echo '<i class="fas fa-star"></i>';
  614.                                                     echo '<i class="far fa-star"></i>';
  615.                                                     echo '<i class="far fa-star"></i>';
  616.                                                 }elseif( $single_data['client_rating'] == 'four' ){
  617.                                                     echo '<i class="fas fa-star"></i>';
  618.                                                     echo '<i class="fas fa-star"></i>';
  619.                                                     echo '<i class="fas fa-star"></i>';
  620.                                                     echo '<i class="fas fa-star"></i>';
  621.                                                     echo '<i class="far fa-star"></i>';
  622.                                                 }else{
  623.                                                     echo '<i class="fas fa-star"></i>';
  624.                                                     echo '<i class="fas fa-star"></i>';
  625.                                                     echo '<i class="fas fa-star"></i>';
  626.                                                     echo '<i class="fas fa-star"></i>';
  627.                                                     echo '<i class="fas fa-star"></i>';
  628.                                                 }
  629.                                             echo '</div>';
  630.                                             if( ! empty( $settings['quote']['url'] ) ){
  631.                                                 echo '<div class="icon">';
  632.                                                     echo travil_img_tag( array(
  633.                                                         'url'   => esc_url( $settings['quote']['url'] ),
  634.                                                     ) );
  635.                                                 echo '</div>';
  636.                                             }
  637.                                             if(!empty($single_data['feedback'])){
  638.                                                 echo '<h3>'.wp_kses_post( $single_data['feedback'] ).'</h3>';
  639.                                             }
  640.                                             echo '<div class="client-info">';
  641.                                                 if(!empty($single_data['name'])){
  642.                                                     echo '<h4>'.wp_kses_post( $single_data['name'] ).'</h4>';
  643.                                                 }
  644.                                                 if(!empty($single_data['from'])){
  645.                                                     echo ' <span class="from__class">'.esc_html( $single_data['from'] ).'</span>';
  646.                                                 }
  647.                                             echo '</div>';
  648.                                         echo '</div>';
  649.                                     echo '</div>';
  650.                                 }
  651.                                
  652.  
  653.                            echo '</div>';
  654.                         echo '</div>';
  655.                     echo '</div>';
  656.                 echo '</section>';
  657.             }elseif($settings['testimonials_style'] == 2 ) {
  658.                 echo '<section class="testimonial-section-5 fix">';
  659.                     echo '<div class="container">';
  660.                         echo '<div class="section-title-area">';
  661.                             echo '<div class="section-title style-2">';
  662.                                 echo '<span class="wow fadeInUp">' . esc_html( $settings['subtitle'] ) . '</span>';
  663.                                 echo '<h2 class="wow fadeInUp" data-wow-delay=".3s">' . wp_kses_post( $settings['title'] ) . '</h2>';
  664.                             echo '</div>';
  665.                             echo '<div class="test-left-top">';
  666.                                 if( ! empty( $settings['shape']['url'] ) ){
  667.                                     echo travil_img_tag( array(
  668.                                         'url'   => esc_url( $settings['shape']['url'] ),
  669.                                     ) );
  670.                                 }
  671.                                 if(!empty($settings['ratting_text'])){
  672.                                      echo '<div class="content">';
  673.                                    
  674.                                      echo wp_kses_post( $settings['ratting_text'] );
  675.  
  676.                                     echo '</div>';                      
  677.                                 }
  678.                                
  679.                             echo '</div>';
  680.                         echo '</div>';
  681.                         echo '<div class="row align-items-center">';
  682.                             echo '<div class="col-lg-6">';
  683.                                 echo '<div class="testimonail-image-5">';
  684.                                     if( ! empty( $settings['thumb']['url'] ) ){
  685.                                         echo travil_img_tag( array(
  686.                                             'url'   => esc_url( $settings['thumb']['url'] ),
  687.                                         ) );
  688.                                     }
  689.                                 echo '</div>';
  690.                            echo ' </div>';
  691.                             echo '<div class="col-lg-6">';
  692.                                 echo '<div class="swiper testimonial-slider-5">';
  693.                                     echo '<div class="swiper-wrapper">';
  694.  
  695.  
  696.                                         foreach( $settings['slides'] as $single_data ){
  697.                                            echo ' <div class="swiper-slide">';
  698.                                                 echo '<div class="testimonial-box-items-4 box-shadow-none">';
  699.                                                     if( ! empty( $single_data['img']['url'] ) ){
  700.                                                         echo '<div class="testi-img">';
  701.                                                             echo travil_img_tag( array(
  702.                                                                 'url'   => esc_url( $single_data['img']['url'] ),
  703.                                                             ) );
  704.                                                         echo '</div>';
  705.                                                     }
  706.                                                     echo '<div class="star">';
  707.                                                         if( $single_data['client_rating'] == 'one' ){
  708.                                                             echo '<i class="fas fa-star"></i>';
  709.                                                             echo '<i class="far fa-star"></i>';
  710.                                                             echo '<i class="far fa-star"></i>';
  711.                                                             echo '<i class="far fa-star"></i>';
  712.                                                             echo '<i class="far fa-star"></i>';
  713.                                                         }elseif( $single_data['client_rating'] == 'two' ){
  714.                                                             echo '<i class="fas fa-star"></i>';
  715.                                                             echo '<i class="fas fa-star"></i>';
  716.                                                             echo '<i class="far fa-star"></i>';
  717.                                                             echo '<i class="far fa-star"></i>';
  718.                                                             echo '<i class="far fa-star"></i>';
  719.                                                         }elseif( $single_data['client_rating'] == 'three' ){
  720.                                                             echo '<i class="fas fa-star"></i>';
  721.                                                             echo '<i class="fas fa-star"></i>';
  722.                                                             echo '<i class="fas fa-star"></i>';
  723.                                                             echo '<i class="far fa-star"></i>';
  724.                                                             echo '<i class="far fa-star"></i>';
  725.                                                         }elseif( $single_data['client_rating'] == 'four' ){
  726.                                                             echo '<i class="fas fa-star"></i>';
  727.                                                             echo '<i class="fas fa-star"></i>';
  728.                                                             echo '<i class="fas fa-star"></i>';
  729.                                                             echo '<i class="fas fa-star"></i>';
  730.                                                             echo '<i class="far fa-star"></i>';
  731.                                                         }else{
  732.                                                             echo '<i class="fas fa-star"></i>';
  733.                                                             echo '<i class="fas fa-star"></i>';
  734.                                                             echo '<i class="fas fa-star"></i>';
  735.                                                             echo '<i class="fas fa-star"></i>';
  736.                                                             echo '<i class="fas fa-star"></i>';
  737.                                                         }
  738.                                                     echo '</div>';
  739.                                                     if( ! empty( $settings['quote']['url'] ) ){
  740.                                                         echo '<div class="icon">';
  741.                                                             echo travil_img_tag( array(
  742.                                                                 'url'   => esc_url( $settings['quote']['url'] ),
  743.                                                             ) );
  744.                                                         echo '</div>';
  745.                                                     }
  746.                                                     if(!empty($single_data['feedback'])){
  747.                                                         echo '<h3>'.wp_kses_post( $single_data['feedback'] ).'</h3>';
  748.                                                     }
  749.                                                     echo '<div class="client-info">';
  750.                                                         if(!empty($single_data['name'])){
  751.                                                             echo '<h4>'.wp_kses_post( $single_data['name'] ).'</h4>';
  752.                                                         }
  753.                                                         if(!empty($single_data['from'])){
  754.                                                             echo ' <span class="from__class">'.esc_html( $single_data['from'] ).'</span>';
  755.                                                         }
  756.                                                     echo '</div>';
  757.                                                 echo '</div>';
  758.                                             echo '</div>';
  759.                                         }
  760.                                        
  761.  
  762.                                     echo '</div>';
  763.                                     echo '<div class="swiper-dot4 mt-4 text-center">';
  764.                                         echo '<div class="dot11"></div>';
  765.                                     echo '</div>';
  766.                                 echo '</div>';
  767.                             echo '</div>';
  768.                         echo '</div>';
  769.                     echo '</div>';
  770.                 echo '</section>';
  771.             }else{
  772.                 echo '<section class="testimonial-section-3 section-padding pt-0">';
  773.                     echo '<div class="array-button style-2">';
  774.                         echo '<button class="array-prev"><i class="far fa-long-arrow-left"></i></button>';
  775.                         echo '<button class="array-next"><i class="far fa-long-arrow-right"></i></button>';
  776.                     echo '</div>';
  777.                     echo '<div class="container">';
  778.                         echo '<div class="section-title text-center">';
  779.                             echo '<span class="wow fadeInUp">' . esc_html( $settings['subtitle'] ) . '</span>';
  780.                             echo '<h2 class="wow fadeInUp" data-wow-delay=".3s">' . wp_kses_post( $settings['title'] ) . '</h2>';
  781.                         echo '</div>';
  782.                         echo '<div class="swiper testimonial-slider-3">';
  783.                             echo '<div class="swiper-wrapper">';
  784.  
  785.                                 foreach( $settings['slides'] as $single_data ){
  786.                                     echo '<div class="swiper-slide">';
  787.                                         echo '<div class="testimonial-box-items2">';
  788.                                             echo '<div class="star">';
  789.                                                 if( $single_data['client_rating'] == 'one' ){
  790.                                                     echo '<i class="fas fa-star"></i>';
  791.                                                     echo '<i class="far fa-star"></i>';
  792.                                                     echo '<i class="far fa-star"></i>';
  793.                                                     echo '<i class="far fa-star"></i>';
  794.                                                     echo '<i class="far fa-star"></i>';
  795.                                                 }elseif( $single_data['client_rating'] == 'two' ){
  796.                                                     echo '<i class="fas fa-star"></i>';
  797.                                                     echo '<i class="fas fa-star"></i>';
  798.                                                     echo '<i class="far fa-star"></i>';
  799.                                                     echo '<i class="far fa-star"></i>';
  800.                                                     echo '<i class="far fa-star"></i>';
  801.                                                 }elseif( $single_data['client_rating'] == 'three' ){
  802.                                                     echo '<i class="fas fa-star"></i>';
  803.                                                     echo '<i class="fas fa-star"></i>';
  804.                                                     echo '<i class="fas fa-star"></i>';
  805.                                                     echo '<i class="far fa-star"></i>';
  806.                                                     echo '<i class="far fa-star"></i>';
  807.                                                 }elseif( $single_data['client_rating'] == 'four' ){
  808.                                                     echo '<i class="fas fa-star"></i>';
  809.                                                     echo '<i class="fas fa-star"></i>';
  810.                                                     echo '<i class="fas fa-star"></i>';
  811.                                                     echo '<i class="fas fa-star"></i>';
  812.                                                     echo '<i class="far fa-star"></i>';
  813.                                                 }else{
  814.                                                     echo '<i class="fas fa-star"></i>';
  815.                                                     echo '<i class="fas fa-star"></i>';
  816.                                                     echo '<i class="fas fa-star"></i>';
  817.                                                     echo '<i class="fas fa-star"></i>';
  818.                                                     echo '<i class="fas fa-star"></i>';
  819.                                                 }
  820.  
  821.  
  822.                                             echo '</div>';
  823.                                             if(!empty($single_data['feedback'])){
  824.                                                 echo '<h3>'.wp_kses_post( $single_data['feedback'] ).'</h3>';
  825.                                             }
  826.                                             echo '<div class="client-info-items">';
  827.                                             echo '<div class="client-info">';
  828.                                                 if( ! empty( $single_data['img']['url'] ) ){
  829.                                                     echo '<div class="client-img">';
  830.                                                         echo travil_img_tag( array(
  831.                                                             'url'   => esc_url( $single_data['img']['url'] ),
  832.                                                         ) );
  833.                                                     echo '</div>';
  834.                                                 }
  835.                                                 echo '<div class="client-content">';
  836.                                                     if(!empty($single_data['name'])){
  837.                                                         echo '<h4>'.wp_kses_post( $single_data['name'] ).'</h4>';
  838.                                                     }
  839.                                                     if(!empty($single_data['from'])){
  840.                                                         echo ' <span class="from__class">'.esc_html( $single_data['from'] ).'</span>';
  841.                                                     }
  842.                                                 echo '</div>';
  843.                                             echo ' </div>';
  844.                                             if( ! empty( $settings['quote']['url'] ) ){
  845.                                                 echo '<div class="icon">';
  846.                                                     echo travil_img_tag( array(
  847.                                                         'url'   => esc_url( $settings['quote']['url'] ),
  848.                                                     ) );
  849.                                                 echo '</div>';
  850.                                             }
  851.                                            echo '</div>';
  852.                                         echo '</div>';
  853.                                     echo '</div>';
  854.                                 }
  855.                              echo '</div>  ';
  856.                         echo '</div>';
  857.                     echo '</div>';
  858.                 echo '</section>';
  859.             }
  860.  
  861.         echo '<!--------------------------------- Testimonials Area end --------------------------------->';
  862.     }
  863. }
Add Comment
Please, Sign In to add comment