| 1 |
<?php |
| 2 |
/** |
| 3 |
* @author WpBean |
| 4 |
* @version 1.0 |
| 5 |
*/ |
| 6 |
|
| 7 |
if ( ! defined( 'ABSPATH' ) ) { |
| 8 |
exit; // Exit if accessed directly. |
| 9 |
} |
| 10 |
|
| 11 |
use Elementor\Controls_Manager; |
| 12 |
use Elementor\Group_Control_Border; |
| 13 |
use Elementor\Group_Control_Box_Shadow; |
| 14 |
use Elementor\Group_Control_Image_Size; |
| 15 |
|
| 16 |
class WPB_EA_Widget_Testimonial extends \Elementor\Widget_Base { |
| 17 |
|
| 18 |
public function get_name() { |
| 19 |
return 'wpb-ea-testimonial'; |
| 20 |
} |
| 21 |
|
| 22 |
public function get_title() { |
| 23 |
return esc_html__( 'WPB Testimonial', 'wpb-elementor-addons' ); |
| 24 |
} |
| 25 |
|
| 26 |
public function get_icon() { |
| 27 |
return 'eicon-testimonial-carousel'; |
| 28 |
} |
| 29 |
|
| 30 |
public function get_categories() { |
| 31 |
return array( 'wpb_ea_widgets' ); |
| 32 |
} |
| 33 |
|
| 34 |
/** |
| 35 |
* Retrieve the list of scripts the counter widget depended on. |
| 36 |
* |
| 37 |
* Used to set scripts dependencies required to run the widget. |
| 38 |
* |
| 39 |
* @since 1.3.0 |
| 40 |
* @access public |
| 41 |
* |
| 42 |
* @return array Widget scripts dependencies. |
| 43 |
*/ |
| 44 |
public function get_script_depends() { |
| 45 |
return array( |
| 46 |
'wpb-ea-owl-carousel', |
| 47 |
'wpb-ea-super-js', |
| 48 |
); |
| 49 |
} |
| 50 |
|
| 51 |
protected function register_controls() { |
| 52 |
$wpb_ea_primary_color = wpb_ea_get_option( 'wpb_ea_primary_color', 'wpb_ea_style', '#3878ff' ); |
| 53 |
|
| 54 |
// testimonial section |
| 55 |
$this->start_controls_section( |
| 56 |
'wpb_ea_testimonial', |
| 57 |
array( |
| 58 |
'label' => esc_html__( 'Testimonials', 'wpb-elementor-addons' ), |
| 59 |
) |
| 60 |
); |
| 61 |
|
| 62 |
// testimonial conent type |
| 63 |
$this->add_control( |
| 64 |
'wpb_ea_testimonial_content_type', |
| 65 |
array( |
| 66 |
'label' => esc_html__( 'Content Type', 'wpb-elementor-addons' ), |
| 67 |
'type' => Controls_Manager::SELECT, |
| 68 |
'default' => 'slider', |
| 69 |
'options' => array( |
| 70 |
'slider' => esc_html__( 'Slider', 'wpb-elementor-addons' ), |
| 71 |
'grid' => esc_html__( 'Grid', 'wpb-elementor-addons' ), |
| 72 |
), |
| 73 |
'separator' => 'after', |
| 74 |
) |
| 75 |
); |
| 76 |
|
| 77 |
$repeater = new \Elementor\Repeater(); |
| 78 |
|
| 79 |
$repeater->add_control( |
| 80 |
'wpb_ea_testimonial_title', |
| 81 |
array( |
| 82 |
'label' => esc_html__( 'Title', 'wpb-elementor-addons' ), |
| 83 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 84 |
'placeholder' => esc_html__( 'Testimonial Title', 'wpb-elementor-addons' ), |
| 85 |
'default' => esc_html__( 'Professional Team', 'wpb-elementor-addons' ), |
| 86 |
'label_block' => true, |
| 87 |
) |
| 88 |
); |
| 89 |
|
| 90 |
$repeater->add_control( |
| 91 |
'wpb_ea_testimonial_content', |
| 92 |
array( |
| 93 |
'label' => esc_html__( 'Content', 'wpb-elementor-addons' ), |
| 94 |
'type' => \Elementor\Controls_Manager::WYSIWYG, |
| 95 |
'placeholder' => esc_html__( 'Testimonial Details.', 'wpb-elementor-addons' ), |
| 96 |
'default' => esc_html__( 'Nullam a ultrices ex, quis finibus neque. Etiam facilisis consectetur ante ac bibendum. Sed pretium lacinia sollicitudin.', 'wpb-elementor-addons' ), |
| 97 |
) |
| 98 |
); |
| 99 |
|
| 100 |
$repeater->add_control( |
| 101 |
'wpb_ea_testimonial_client_name', |
| 102 |
array( |
| 103 |
'label' => esc_html__( 'Name', 'wpb-elementor-addons' ), |
| 104 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 105 |
'placeholder' => esc_html__( 'Client\'s Name', 'wpb-elementor-addons' ), |
| 106 |
'default' => esc_html__( 'John Doe', 'wpb-elementor-addons' ), |
| 107 |
'label_block' => true, |
| 108 |
) |
| 109 |
); |
| 110 |
|
| 111 |
$repeater->add_control( |
| 112 |
'wpb_ea_testimonial_client_designation', |
| 113 |
array( |
| 114 |
'label' => esc_html__( 'Designation', 'wpb-elementor-addons' ), |
| 115 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 116 |
'placeholder' => esc_html__( 'Client\'s Designation', 'wpb-elementor-addons' ), |
| 117 |
'default' => esc_html__( 'Developer', 'wpb-elementor-addons' ), |
| 118 |
'label_block' => true, |
| 119 |
) |
| 120 |
); |
| 121 |
|
| 122 |
$repeater->add_control( |
| 123 |
'wpb_ea_testimonial_client_company', |
| 124 |
array( |
| 125 |
'label' => esc_html__( 'Company', 'wpb-elementor-addons' ), |
| 126 |
'type' => \Elementor\Controls_Manager::TEXT, |
| 127 |
'placeholder' => esc_html__( 'Client\'s Company', 'wpb-elementor-addons' ), |
| 128 |
'default' => esc_html__( 'ABC Company', 'wpb-elementor-addons' ), |
| 129 |
'label_block' => true, |
| 130 |
) |
| 131 |
); |
| 132 |
|
| 133 |
$repeater->add_control( |
| 134 |
'image', |
| 135 |
array( |
| 136 |
'label' => esc_html__( 'Image', 'wpb-elementor-addons' ), |
| 137 |
'type' => Controls_Manager::MEDIA, |
| 138 |
'default' => array(), |
| 139 |
) |
| 140 |
); |
| 141 |
|
| 142 |
$this->add_control( |
| 143 |
'wpb_ea_testimonial_items', |
| 144 |
array( |
| 145 |
'label' => esc_html__( 'Testimonial Items', 'wpb-elementor-addons' ), |
| 146 |
'type' => \Elementor\Controls_Manager::REPEATER, |
| 147 |
'default' => array( |
| 148 |
array( |
| 149 |
'wpb_ea_testimonial_title' => esc_html__( 'Professional Team', 'wpb-elementor-addons' ), |
| 150 |
'wpb_ea_testimonial_content' => esc_html__( 'Nullam a ultrices ex, quis finibus neque. Etiam facilisis consectetur ante ac bibendum. Sed pretium lacinia sollicitudin.', 'wpb-elementor-addons' ), |
| 151 |
'wpb_ea_testimonial_client_name' => esc_html__( 'John Doe', 'wpb-elementor-addons' ), |
| 152 |
'wpb_ea_testimonial_client_designation' => esc_html__( 'Developer', 'wpb-elementor-addons' ), |
| 153 |
'wpb_ea_testimonial_client_company' => esc_html__( 'ABC Company', 'wpb-elementor-addons' ), |
| 154 |
), |
| 155 |
array( |
| 156 |
'wpb_ea_testimonial_title' => esc_html__( 'Awesome Support', 'wpb-elementor-addons' ), |
| 157 |
'wpb_ea_testimonial_content' => esc_html__( 'Nullam a ultrices ex, quis finibus neque. Etiam facilisis consectetur ante ac bibendum. Sed pretium lacinia sollicitudin.', 'wpb-elementor-addons' ), |
| 158 |
'wpb_ea_testimonial_client_name' => esc_html__( 'Aaron Sylvester', 'wpb-elementor-addons' ), |
| 159 |
'wpb_ea_testimonial_client_designation' => esc_html__( 'Designer', 'wpb-elementor-addons' ), |
| 160 |
'wpb_ea_testimonial_client_company' => esc_html__( 'Romp', 'wpb-elementor-addons' ), |
| 161 |
), |
| 162 |
array( |
| 163 |
'wpb_ea_testimonial_title' => esc_html__( 'Excellenet Service', 'wpb-elementor-addons' ), |
| 164 |
'wpb_ea_testimonial_content' => esc_html__( 'Nullam a ultrices ex, quis finibus neque. Etiam facilisis consectetur ante ac bibendum. Sed pretium lacinia sollicitudin.', 'wpb-elementor-addons' ), |
| 165 |
'wpb_ea_testimonial_client_name' => esc_html__( 'Sherry Hernandez', 'wpb-elementor-addons' ), |
| 166 |
'wpb_ea_testimonial_client_designation' => esc_html__( 'C.E.O', 'wpb-elementor-addons' ), |
| 167 |
'wpb_ea_testimonial_client_company' => esc_html__( 'Ransohoffs', 'wpb-elementor-addons' ), |
| 168 |
), |
| 169 |
), |
| 170 |
'fields' => $repeater->get_controls(), |
| 171 |
'title_field' => '{{{ wpb_ea_testimonial_title }}}', |
| 172 |
) |
| 173 |
); |
| 174 |
|
| 175 |
// testimonial extra CSS heading |
| 176 |
$this->add_control( |
| 177 |
'wpb_ea_test_extra_css_heading', |
| 178 |
array( |
| 179 |
'type' => Controls_Manager::HEADING, |
| 180 |
'separator' => 'before', |
| 181 |
) |
| 182 |
); |
| 183 |
|
| 184 |
// extra CSS class |
| 185 |
$this->add_control( |
| 186 |
'extra_css', |
| 187 |
array( |
| 188 |
'label' => esc_html__( 'Extra CSS clss', 'wpb-elementor-addons' ), |
| 189 |
'type' => Controls_Manager::TEXT, |
| 190 |
'description' => esc_html__( 'Put your extra CSS class if you need.', 'wpb-elementor-addons' ), |
| 191 |
'placeholder' => esc_html__( 'your-extra-css-class', 'wpb-elementor-addons' ), |
| 192 |
) |
| 193 |
); |
| 194 |
|
| 195 |
$this->end_controls_section(); |
| 196 |
|
| 197 |
/** |
| 198 |
* ------------------------------------------- |
| 199 |
* testimonial settings tab starts here |
| 200 |
* ------------------------------------------- |
| 201 |
*/ |
| 202 |
|
| 203 |
/** |
| 204 |
* ------------------------------------------- |
| 205 |
* testimonial item's carousel section |
| 206 |
* ------------------------------------------- |
| 207 |
*/ |
| 208 |
$this->start_controls_section( |
| 209 |
'wpb_ea_testimonial_carousel_settings', |
| 210 |
array( |
| 211 |
'label' => esc_html__( 'Carousel Settings', 'wpb-elementor-addons' ), |
| 212 |
'tab' => Controls_Manager::TAB_SETTINGS, |
| 213 |
'condition' => array( |
| 214 |
'.wpb_ea_testimonial.wpb_ea_testimonial_content_type' => 'slider', |
| 215 |
), |
| 216 |
) |
| 217 |
); |
| 218 |
|
| 219 |
// show navigation? |
| 220 |
$this->add_control( |
| 221 |
'arrows', |
| 222 |
array( |
| 223 |
'type' => Controls_Manager::SWITCHER, |
| 224 |
'label' => esc_html__( 'Show Prev/Next Arrows?', 'wpb-elementor-addons' ), |
| 225 |
'default' => 'yes', |
| 226 |
'return_value' => 'yes', |
| 227 |
) |
| 228 |
); |
| 229 |
|
| 230 |
// show pagination? |
| 231 |
$this->add_control( |
| 232 |
'dots', |
| 233 |
array( |
| 234 |
'type' => Controls_Manager::SWITCHER, |
| 235 |
'label' => esc_html__( 'Show dot indicators for navigation?', 'wpb-elementor-addons' ), |
| 236 |
'default' => 'no', |
| 237 |
'return_value' => 'yes', |
| 238 |
) |
| 239 |
); |
| 240 |
|
| 241 |
// pause on hover? |
| 242 |
$this->add_control( |
| 243 |
'pause_on_hover', |
| 244 |
array( |
| 245 |
'type' => Controls_Manager::SWITCHER, |
| 246 |
'label' => esc_html__( 'Pause on Hover?', 'wpb-elementor-addons' ), |
| 247 |
'default' => 'no', |
| 248 |
'return_value' => 'yes', |
| 249 |
) |
| 250 |
); |
| 251 |
|
| 252 |
// slider autoplay? |
| 253 |
$this->add_control( |
| 254 |
'autoplay', |
| 255 |
array( |
| 256 |
'type' => Controls_Manager::SWITCHER, |
| 257 |
'label' => esc_html__( 'Autoplay?', 'wpb-elementor-addons' ), |
| 258 |
'default' => 'no', |
| 259 |
'return_value' => 'yes', |
| 260 |
'description' => esc_html__( 'Show the carousel autoplay as in a slideshow.', 'wpb-elementor-addons' ), |
| 261 |
) |
| 262 |
); |
| 263 |
|
| 264 |
// slider loop? |
| 265 |
$this->add_control( |
| 266 |
'loop', |
| 267 |
array( |
| 268 |
'type' => Controls_Manager::SWITCHER, |
| 269 |
'label' => esc_html__( 'Loop?', 'wpb-elementor-addons' ), |
| 270 |
'default' => 'no', |
| 271 |
'return_value' => 'yes', |
| 272 |
'description' => esc_html__( 'Show the carousel loop as in a slideshow.', 'wpb-elementor-addons' ), |
| 273 |
) |
| 274 |
); |
| 275 |
|
| 276 |
// margin between two slider items |
| 277 |
$this->add_control( |
| 278 |
'slidergap', |
| 279 |
array( |
| 280 |
'label' => esc_html__( 'Gap between the slider items', 'wpb-elementor-addons' ), |
| 281 |
'type' => Controls_Manager::SLIDER, |
| 282 |
'default' => array( |
| 283 |
'size' => 30, |
| 284 |
), |
| 285 |
'range' => array( |
| 286 |
'px' => array( |
| 287 |
'min' => 0, |
| 288 |
'max' => 300, |
| 289 |
), |
| 290 |
), |
| 291 |
) |
| 292 |
); |
| 293 |
|
| 294 |
// margin below the slider item |
| 295 |
$this->add_control( |
| 296 |
'slider_item_margin_bottom', |
| 297 |
array( |
| 298 |
'label' => esc_html__( 'Gap below the slider item', 'wpb-elementor-addons' ), |
| 299 |
'type' => \Elementor\Controls_Manager::SLIDER, |
| 300 |
'range' => array( |
| 301 |
'px' => array( |
| 302 |
'min' => 0, |
| 303 |
'max' => 300, |
| 304 |
), |
| 305 |
), |
| 306 |
'selectors' => array( |
| 307 |
'{{WRAPPER}} .wpb-ea-testimonial-items-slider .wpb-ea-testimonial-item' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 308 |
), |
| 309 |
) |
| 310 |
); |
| 311 |
|
| 312 |
$this->end_controls_section(); |
| 313 |
|
| 314 |
/** |
| 315 |
* ------------------------------------------- |
| 316 |
* testimonial item's responsive section |
| 317 |
* ------------------------------------------- |
| 318 |
*/ |
| 319 |
$this->start_controls_section( |
| 320 |
'section_responsive', |
| 321 |
array( |
| 322 |
'label' => esc_html__( 'Responsive Options', 'wpb-elementor-addons' ), |
| 323 |
'tab' => Controls_Manager::TAB_SETTINGS, |
| 324 |
) |
| 325 |
); |
| 326 |
|
| 327 |
$this->add_control( |
| 328 |
'heading_desktop', |
| 329 |
array( |
| 330 |
'label' => esc_html__( 'Desktop', 'wpb-elementor-addons' ), |
| 331 |
'type' => Controls_Manager::HEADING, |
| 332 |
) |
| 333 |
); |
| 334 |
|
| 335 |
// testimonial type grid desktop column |
| 336 |
$this->add_control( |
| 337 |
'testimonial_type_grid_desktop_column', |
| 338 |
array( |
| 339 |
'label' => esc_html__( 'Number of Columns', 'wpb-elementor-addons' ), |
| 340 |
'type' => Controls_Manager::SELECT, |
| 341 |
'default' => 3, |
| 342 |
'options' => array( |
| 343 |
6 => esc_html__( '6 Columns', 'wpb-elementor-addons' ), |
| 344 |
4 => esc_html__( '4 Columns', 'wpb-elementor-addons' ), |
| 345 |
3 => esc_html__( '3 Columns', 'wpb-elementor-addons' ), |
| 346 |
2 => esc_html__( '2 Columns', 'wpb-elementor-addons' ), |
| 347 |
1 => esc_html__( '1 Columns', 'wpb-elementor-addons' ), |
| 348 |
), |
| 349 |
'condition' => array( |
| 350 |
'.wpb_ea_testimonial.wpb_ea_testimonial_content_type' => 'grid', |
| 351 |
), |
| 352 |
) |
| 353 |
); |
| 354 |
|
| 355 |
// number of items in desktop |
| 356 |
$this->add_control( |
| 357 |
'desktop_columns', |
| 358 |
array( |
| 359 |
'label' => esc_html__( 'Columns per row', 'wpb-elementor-addons' ), |
| 360 |
'type' => Controls_Manager::NUMBER, |
| 361 |
'min' => 1, |
| 362 |
'max' => 8, |
| 363 |
'step' => 1, |
| 364 |
'default' => 3, |
| 365 |
'condition' => array( |
| 366 |
'.wpb_ea_testimonial.wpb_ea_testimonial_content_type' => 'slider', |
| 367 |
), |
| 368 |
) |
| 369 |
); |
| 370 |
|
| 371 |
$this->add_control( |
| 372 |
'small_heading_desktop', |
| 373 |
array( |
| 374 |
'label' => esc_html__( 'Desktop Small', 'wpb-elementor-addons' ), |
| 375 |
'type' => Controls_Manager::HEADING, |
| 376 |
'separator' => 'before', |
| 377 |
'condition' => array( |
| 378 |
'.wpb_ea_testimonial.wpb_ea_testimonial_content_type' => 'slider', |
| 379 |
), |
| 380 |
) |
| 381 |
); |
| 382 |
|
| 383 |
// number of items in small desktop |
| 384 |
$this->add_control( |
| 385 |
'small_desktop_columns', |
| 386 |
array( |
| 387 |
'label' => esc_html__( 'Columns per row', 'wpb-elementor-addons' ), |
| 388 |
'type' => Controls_Manager::NUMBER, |
| 389 |
'min' => 1, |
| 390 |
'max' => 7, |
| 391 |
'step' => 1, |
| 392 |
'default' => 3, |
| 393 |
'condition' => array( |
| 394 |
'.wpb_ea_testimonial.wpb_ea_testimonial_content_type' => 'slider', |
| 395 |
), |
| 396 |
) |
| 397 |
); |
| 398 |
|
| 399 |
$this->add_control( |
| 400 |
'heading_tablet', |
| 401 |
array( |
| 402 |
'label' => esc_html__( 'Tablet', 'wpb-elementor-addons' ), |
| 403 |
'type' => Controls_Manager::HEADING, |
| 404 |
'separator' => 'before', |
| 405 |
) |
| 406 |
); |
| 407 |
|
| 408 |
// number of items in tablet |
| 409 |
$this->add_control( |
| 410 |
'tablet_display_columns', |
| 411 |
array( |
| 412 |
'label' => esc_html__( 'Columns per row', 'wpb-elementor-addons' ), |
| 413 |
'type' => Controls_Manager::NUMBER, |
| 414 |
'min' => 1, |
| 415 |
'max' => 5, |
| 416 |
'step' => 1, |
| 417 |
'default' => 2, |
| 418 |
'condition' => array( |
| 419 |
'.wpb_ea_testimonial.wpb_ea_testimonial_content_type' => 'slider', |
| 420 |
), |
| 421 |
) |
| 422 |
); |
| 423 |
|
| 424 |
// testimonial type grid tablet column |
| 425 |
$this->add_control( |
| 426 |
'testimonial_type_grid_tablet_column', |
| 427 |
array( |
| 428 |
'label' => esc_html__( 'Column', 'wpb-elementor-addons' ), |
| 429 |
'type' => Controls_Manager::SELECT, |
| 430 |
'default' => 2, |
| 431 |
'options' => array( |
| 432 |
6 => esc_html__( '6 Columns', 'wpb-elementor-addons' ), |
| 433 |
4 => esc_html__( '4 Columns', 'wpb-elementor-addons' ), |
| 434 |
3 => esc_html__( '3 Columns', 'wpb-elementor-addons' ), |
| 435 |
2 => esc_html__( '2 Columns', 'wpb-elementor-addons' ), |
| 436 |
1 => esc_html__( '1 Columns', 'wpb-elementor-addons' ), |
| 437 |
), |
| 438 |
'condition' => array( |
| 439 |
'.wpb_ea_testimonial.wpb_ea_testimonial_content_type' => 'grid', |
| 440 |
), |
| 441 |
) |
| 442 |
); |
| 443 |
|
| 444 |
$this->add_control( |
| 445 |
'heading_mobile', |
| 446 |
array( |
| 447 |
'label' => esc_html__( 'Mobile Phone', 'wpb-elementor-addons' ), |
| 448 |
'type' => Controls_Manager::HEADING, |
| 449 |
'separator' => 'before', |
| 450 |
) |
| 451 |
); |
| 452 |
|
| 453 |
// number of items in mobile |
| 454 |
$this->add_control( |
| 455 |
'mobile_display_columns', |
| 456 |
array( |
| 457 |
'label' => esc_html__( 'Columns per row', 'wpb-elementor-addons' ), |
| 458 |
'type' => Controls_Manager::NUMBER, |
| 459 |
'min' => 1, |
| 460 |
'max' => 3, |
| 461 |
'step' => 1, |
| 462 |
'default' => 1, |
| 463 |
'condition' => array( |
| 464 |
'.wpb_ea_testimonial.wpb_ea_testimonial_content_type' => 'slider', |
| 465 |
), |
| 466 |
) |
| 467 |
); |
| 468 |
|
| 469 |
$this->end_controls_section(); |
| 470 |
|
| 471 |
/** |
| 472 |
* ------------------------------------------- |
| 473 |
* testimonial settings tab ends here |
| 474 |
* ------------------------------------------- |
| 475 |
*/ |
| 476 |
|
| 477 |
/** |
| 478 |
* ------------------------------------------- |
| 479 |
* testimonial box style tab starts here |
| 480 |
* ------------------------------------------- |
| 481 |
*/ |
| 482 |
|
| 483 |
/** |
| 484 |
* ------------------------------------------- |
| 485 |
* testimonial box style |
| 486 |
* ------------------------------------------- |
| 487 |
*/ |
| 488 |
|
| 489 |
$this->start_controls_section( |
| 490 |
'wpb_ea_testimonial_style_section', |
| 491 |
array( |
| 492 |
'label' => esc_html__( 'Testimonial Box Style', 'wpb-elementor-addons' ), |
| 493 |
'tab' => Controls_Manager::TAB_STYLE, |
| 494 |
) |
| 495 |
); |
| 496 |
|
| 497 |
// testimonial background color |
| 498 |
$this->add_control( |
| 499 |
'wpb_ea_testimonial_bg_color', |
| 500 |
array( |
| 501 |
'label' => esc_html__( 'Background Color', 'wpb-elementor-addons' ), |
| 502 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 503 |
'default' => '#ffffff', |
| 504 |
'selectors' => array( |
| 505 |
'{{WRAPPER}} .wpb-ea-testimonial-item' => 'background-color: {{VALUE}};', |
| 506 |
), |
| 507 |
) |
| 508 |
); |
| 509 |
|
| 510 |
// testimonial padding |
| 511 |
$this->add_control( |
| 512 |
'wpb_ea_testimonial_padding', |
| 513 |
array( |
| 514 |
'label' => esc_html__( 'Padding', 'wpb-elementor-addons' ), |
| 515 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 516 |
'size_units' => array( 'px', 'em', '%' ), |
| 517 |
'selectors' => array( |
| 518 |
'{{WRAPPER}} .wpb-ea-testimonial-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 519 |
), |
| 520 |
) |
| 521 |
); |
| 522 |
|
| 523 |
// testimonial margin |
| 524 |
$this->add_control( |
| 525 |
'wpb_ea_testimonial_margin', |
| 526 |
array( |
| 527 |
'label' => esc_html__( 'Margin', 'wpb-elementor-addons' ), |
| 528 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 529 |
'size_units' => array( 'px', 'em', '%' ), |
| 530 |
'default' => array( |
| 531 |
'bottom' => 30, |
| 532 |
), |
| 533 |
'selectors' => array( |
| 534 |
'{{WRAPPER}} .wpb-ea-testimonial-items-grid .wpb-ea-testimonial-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 535 |
), |
| 536 |
'condition' => array( |
| 537 |
'.wpb_ea_testimonial.wpb_ea_testimonial_content_type' => 'grid', |
| 538 |
), |
| 539 |
) |
| 540 |
); |
| 541 |
|
| 542 |
// testimonial border type |
| 543 |
$this->add_group_control( |
| 544 |
Group_Control_Border::get_type(), |
| 545 |
array( |
| 546 |
'name' => 'wpb_ea_testimonial_border_type', |
| 547 |
'label' => esc_html__( 'Border Type', 'wpb-elementor-addons' ), |
| 548 |
'selector' => '{{WRAPPER}} .wpb-ea-testimonial-item', |
| 549 |
) |
| 550 |
); |
| 551 |
|
| 552 |
// testimonial border radius |
| 553 |
$this->add_control( |
| 554 |
'wpb_ea_testimonial_border_radius', |
| 555 |
array( |
| 556 |
'label' => esc_html__( 'Border Radius', 'wpb-elementor-addons' ), |
| 557 |
'type' => Controls_Manager::SLIDER, |
| 558 |
'range' => array( |
| 559 |
'px' => array( |
| 560 |
'max' => 50, |
| 561 |
), |
| 562 |
), |
| 563 |
'selectors' => array( |
| 564 |
'{{WRAPPER}} .wpb-ea-testimonial-item' => 'border-radius: {{SIZE}}px;', |
| 565 |
), |
| 566 |
) |
| 567 |
); |
| 568 |
|
| 569 |
// testimonial box shadow |
| 570 |
$this->add_group_control( |
| 571 |
Group_Control_Box_Shadow::get_type(), |
| 572 |
array( |
| 573 |
'name' => 'wpb_ea_testimonial_box_shadow', |
| 574 |
'selectors' => array( |
| 575 |
'{{WRAPPER}} .wpb-ea-testimonial-item', |
| 576 |
), |
| 577 |
) |
| 578 |
); |
| 579 |
|
| 580 |
// testimonial alignment |
| 581 |
$this->add_responsive_control( |
| 582 |
'wpb_ea_testimonial_align', |
| 583 |
array( |
| 584 |
'label' => esc_html__( 'Alignment', 'wpb-elementor-addons' ), |
| 585 |
'type' => \Elementor\Controls_Manager::CHOOSE, |
| 586 |
'options' => array( |
| 587 |
'left' => array( |
| 588 |
'title' => esc_html__( 'Left', 'wpb-elementor-addons' ), |
| 589 |
'icon' => 'fa fa-align-left', |
| 590 |
), |
| 591 |
'center' => array( |
| 592 |
'title' => esc_html__( 'Center', 'wpb-elementor-addons' ), |
| 593 |
'icon' => 'fa fa-align-center', |
| 594 |
), |
| 595 |
'right' => array( |
| 596 |
'title' => esc_html__( 'Right', 'wpb-elementor-addons' ), |
| 597 |
'icon' => 'fa fa-align-right', |
| 598 |
), |
| 599 |
'justify' => array( |
| 600 |
'title' => esc_html__( 'Justified', 'wpb-elementor-addons' ), |
| 601 |
'icon' => 'fa fa-align-justify', |
| 602 |
), |
| 603 |
), |
| 604 |
'default' => 'center', |
| 605 |
'selectors' => array( |
| 606 |
'{{WRAPPER}} .wpb-ea-testimonial-item' => 'text-align: {{VALUE}};', |
| 607 |
), |
| 608 |
) |
| 609 |
); |
| 610 |
|
| 611 |
$this->end_controls_section(); |
| 612 |
|
| 613 |
/** |
| 614 |
* ------------------------------------------- |
| 615 |
* testimonial image style |
| 616 |
* ------------------------------------------- |
| 617 |
*/ |
| 618 |
|
| 619 |
// testimonial image style |
| 620 |
$this->start_controls_section( |
| 621 |
'wpb_ea_testimonial_image_style', |
| 622 |
array( |
| 623 |
'label' => esc_html__( 'Image', 'wpb-elementor-addons' ), |
| 624 |
'tab' => Controls_Manager::TAB_STYLE, |
| 625 |
) |
| 626 |
); |
| 627 |
|
| 628 |
// testimonial image enable(lightbox) |
| 629 |
$this->add_control( |
| 630 |
'wpb_ea_testimonial_image_lightbox_enable', |
| 631 |
array( |
| 632 |
'label' => esc_html__( 'Enale Lightbox', 'wpb-elementor-addons' ), |
| 633 |
'type' => Controls_Manager::SWITCHER, |
| 634 |
'default' => 'no', |
| 635 |
'return_value' => 'yes', |
| 636 |
) |
| 637 |
); |
| 638 |
|
| 639 |
// testimonial client image size |
| 640 |
$this->add_group_control( |
| 641 |
Group_Control_Image_Size::get_type(), |
| 642 |
array( |
| 643 |
'name' => 'image_size', |
| 644 |
'label' => esc_html__( 'Image Type', 'wpb-elementor-addons' ), |
| 645 |
'default' => 'thumbnail', |
| 646 |
) |
| 647 |
); |
| 648 |
|
| 649 |
// testimonial client image width |
| 650 |
$this->add_control( |
| 651 |
'wpb_ea_testimonial_image_width', |
| 652 |
array( |
| 653 |
'label' => esc_html__( 'Image Width', 'wpb-elementor-addons' ), |
| 654 |
'type' => Controls_Manager::SLIDER, |
| 655 |
'default' => array( |
| 656 |
'size' => 80, |
| 657 |
), |
| 658 |
'range' => array( |
| 659 |
'px' => array( |
| 660 |
'max' => 150, |
| 661 |
), |
| 662 |
), |
| 663 |
'selectors' => array( |
| 664 |
'{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-image img' => 'max-width: {{SIZE}}px;', |
| 665 |
), |
| 666 |
) |
| 667 |
); |
| 668 |
|
| 669 |
// testimonial image border color deep |
| 670 |
$this->add_control( |
| 671 |
'wpb_ea_testimonial_image_border_color_deep', |
| 672 |
array( |
| 673 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 674 |
'label' => esc_html__( 'Border Color( Deep )', 'wpb-elementor-addons' ), |
| 675 |
'default' => $wpb_ea_primary_color, |
| 676 |
'selectors' => array( |
| 677 |
'{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-image.default-border-style img' => 'border-bottom-color: {{VALUE}}; border-left-color: {{VALUE}};', |
| 678 |
), |
| 679 |
) |
| 680 |
); |
| 681 |
|
| 682 |
// testimonial image border color deep |
| 683 |
$this->add_control( |
| 684 |
'wpb_ea_testimonial_image_border_color_light', |
| 685 |
array( |
| 686 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 687 |
'label' => esc_html__( 'Border Color( Light )', 'wpb-elementor-addons' ), |
| 688 |
'default' => '#e8e8e8', |
| 689 |
'selectors' => array( |
| 690 |
'{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-image.default-border-style img' => 'border-top-color: {{VALUE}}; border-right-color: {{VALUE}};', |
| 691 |
), |
| 692 |
) |
| 693 |
); |
| 694 |
|
| 695 |
// testimonial image border radius |
| 696 |
$this->add_control( |
| 697 |
'wpb_ea_testimonial_image_border_radius_style', |
| 698 |
array( |
| 699 |
'label' => esc_html__( 'Border Radius', 'wpb-elementor-addons' ), |
| 700 |
'type' => Controls_Manager::SLIDER, |
| 701 |
'range' => array( |
| 702 |
'px' => array( |
| 703 |
'min' => 0, |
| 704 |
'max' => 100, |
| 705 |
'step' => 2, |
| 706 |
), |
| 707 |
'%' => array( |
| 708 |
'min' => 0, |
| 709 |
'max' => 100, |
| 710 |
'step' => 2, |
| 711 |
), |
| 712 |
), |
| 713 |
'size_units' => array( 'px', '%' ), |
| 714 |
'default' => array( |
| 715 |
'size' => 100, |
| 716 |
'unit' => '%', |
| 717 |
), |
| 718 |
'selectors' => array( |
| 719 |
'{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-image' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 720 |
'{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-image img' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 721 |
), |
| 722 |
) |
| 723 |
); |
| 724 |
|
| 725 |
// testimonial image box shadow |
| 726 |
$this->add_group_control( |
| 727 |
\Elementor\Group_Control_Box_Shadow::get_type(), |
| 728 |
array( |
| 729 |
'name' => 'wpb_ea_testimonial_image_box_shadow_style', |
| 730 |
'selector' => '{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-image', |
| 731 |
'separator' => '', |
| 732 |
) |
| 733 |
); |
| 734 |
|
| 735 |
$this->end_controls_section(); |
| 736 |
|
| 737 |
/** |
| 738 |
* ------------------------------------------- |
| 739 |
* testimonial content style |
| 740 |
* ------------------------------------------- |
| 741 |
*/ |
| 742 |
$this->start_controls_section( |
| 743 |
'wpb_ea_testimonial_content_style', |
| 744 |
array( |
| 745 |
'label' => esc_html__( 'Content', 'wpb-elementor-addons' ), |
| 746 |
'tab' => Controls_Manager::TAB_STYLE, |
| 747 |
) |
| 748 |
); |
| 749 |
|
| 750 |
// testimonial quotes icon style |
| 751 |
$this->add_control( |
| 752 |
'wpb_ea_testimonial_quotes_icon_style', |
| 753 |
array( |
| 754 |
'label' => esc_html__( 'Quote Icon', 'wpb-elementor-addons' ), |
| 755 |
'type' => Controls_Manager::HEADING, |
| 756 |
) |
| 757 |
); |
| 758 |
|
| 759 |
// testimonial quotes icon |
| 760 |
$this->add_control( |
| 761 |
'wpb_ea_testimonial_quotes_icon', |
| 762 |
array( |
| 763 |
'type' => \Elementor\Controls_Manager::ICONS, |
| 764 |
'default' => array( |
| 765 |
'value' => 'fas fa-quote-left', |
| 766 |
'library' => 'solid', |
| 767 |
), |
| 768 |
) |
| 769 |
); |
| 770 |
|
| 771 |
// testimonial quotes icon color |
| 772 |
$this->add_control( |
| 773 |
'wpb_ea_testimonial_quotes_icon_color', |
| 774 |
array( |
| 775 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 776 |
'label' => esc_html__( 'Color', 'wpb-elementor-addons' ), |
| 777 |
'default' => $wpb_ea_primary_color, |
| 778 |
'selectors' => array( |
| 779 |
'{{WRAPPER}} .wpb-ea-testimonial-item .description .quote' => 'color: {{VALUE}};', |
| 780 |
), |
| 781 |
'condition' => array( |
| 782 |
'wpb_ea_testimonial_quotes_icon!' => '', |
| 783 |
), |
| 784 |
) |
| 785 |
); |
| 786 |
|
| 787 |
// testimonial quotes icon typography |
| 788 |
$this->add_group_control( |
| 789 |
\Elementor\Group_Control_Typography::get_type(), |
| 790 |
array( |
| 791 |
'name' => 'wpb_ea_testimonial_quotes_icon_typography', |
| 792 |
'selector' => '{{WRAPPER}} .wpb-ea-testimonial-item .description .quote', |
| 793 |
// font_family, font_size, font_weight, text_transform, font_style, text_decoration, line_height, letter_spacing |
| 794 |
'exclude' => array( |
| 795 |
'text_transform', |
| 796 |
'font_family', |
| 797 |
'font_weight', |
| 798 |
'text_decoration', |
| 799 |
), |
| 800 |
'condition' => array( |
| 801 |
'wpb_ea_testimonial_quotes_icon!' => '', |
| 802 |
), |
| 803 |
) |
| 804 |
); |
| 805 |
|
| 806 |
// testimonial title style |
| 807 |
$this->add_control( |
| 808 |
'wpb_ea_testimonial_title_style', |
| 809 |
array( |
| 810 |
'label' => esc_html__( 'Title', 'wpb-elementor-addons' ), |
| 811 |
'type' => Controls_Manager::HEADING, |
| 812 |
'separator' => 'before', |
| 813 |
) |
| 814 |
); |
| 815 |
|
| 816 |
// testimonial title color |
| 817 |
$this->add_control( |
| 818 |
'wpb_ea_testimonial_title_color', |
| 819 |
array( |
| 820 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 821 |
'label' => esc_html__( 'Color', 'wpb-elementor-addons' ), |
| 822 |
'default' => '#000000', |
| 823 |
'selectors' => array( |
| 824 |
'{{WRAPPER}} .wpb-ea-testimonial-item .description h5.testimonial-title' => 'color: {{VALUE}};', |
| 825 |
), |
| 826 |
) |
| 827 |
); |
| 828 |
|
| 829 |
// testimonial title typography |
| 830 |
$this->add_group_control( |
| 831 |
\Elementor\Group_Control_Typography::get_type(), |
| 832 |
array( |
| 833 |
'name' => 'wpb_ea_testimonial_title_typography', |
| 834 |
'selector' => '{{WRAPPER}} .wpb-ea-testimonial-item .description h5.testimonial-title', |
| 835 |
) |
| 836 |
); |
| 837 |
|
| 838 |
// testimonial title margin |
| 839 |
$this->add_control( |
| 840 |
'wpb_ea_testimonial_title_margin', |
| 841 |
array( |
| 842 |
'label' => esc_html__( 'Margin', 'wpb-elementor-addons' ), |
| 843 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 844 |
'size_units' => array( 'px' ), |
| 845 |
'selectors' => array( |
| 846 |
'{{WRAPPER}} .wpb-ea-testimonial-item .description h5.testimonial-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 847 |
), |
| 848 |
) |
| 849 |
); |
| 850 |
|
| 851 |
// testimonial title padding |
| 852 |
$this->add_control( |
| 853 |
'wpb_ea_testimonial_title_padding', |
| 854 |
array( |
| 855 |
'label' => esc_html__( 'Padding', 'wpb-elementor-addons' ), |
| 856 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 857 |
'size_units' => array( 'px' ), |
| 858 |
'selectors' => array( |
| 859 |
'{{WRAPPER}} .wpb-ea-testimonial-item .description h5.testimonial-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 860 |
), |
| 861 |
) |
| 862 |
); |
| 863 |
|
| 864 |
// testimonial content style |
| 865 |
$this->add_control( |
| 866 |
'wpb_ea_testimonial_content_text_style', |
| 867 |
array( |
| 868 |
'label' => esc_html__( 'Content', 'wpb-elementor-addons' ), |
| 869 |
'type' => Controls_Manager::HEADING, |
| 870 |
'separator' => 'before', |
| 871 |
) |
| 872 |
); |
| 873 |
|
| 874 |
// testimonial content color |
| 875 |
$this->add_control( |
| 876 |
'wpb_ea_testimonial_content_color', |
| 877 |
array( |
| 878 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 879 |
'label' => esc_html__( 'Color', 'wpb-elementor-addons' ), |
| 880 |
'default' => '#777777', |
| 881 |
'selectors' => array( |
| 882 |
'{{WRAPPER}} .wpb-ea-testimonial-item .description p.testimonial-content' => 'color: {{VALUE}};', |
| 883 |
), |
| 884 |
) |
| 885 |
); |
| 886 |
|
| 887 |
// testimonial content typography |
| 888 |
$this->add_group_control( |
| 889 |
\Elementor\Group_Control_Typography::get_type(), |
| 890 |
array( |
| 891 |
'name' => 'wpb_ea_testimonial_content_typography', |
| 892 |
'selector' => '{{WRAPPER}} .wpb-ea-testimonial-item .description p.testimonial-content', |
| 893 |
) |
| 894 |
); |
| 895 |
|
| 896 |
// testimonial content margin |
| 897 |
$this->add_control( |
| 898 |
'wpb_ea_testimonial_content_margin', |
| 899 |
array( |
| 900 |
'label' => esc_html__( 'Margin', 'wpb-elementor-addons' ), |
| 901 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 902 |
'size_units' => array( 'px' ), |
| 903 |
'selectors' => array( |
| 904 |
'{{WRAPPER}} .wpb-ea-testimonial-item .description p.testimonial-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 905 |
), |
| 906 |
) |
| 907 |
); |
| 908 |
|
| 909 |
// testimonial content padding |
| 910 |
$this->add_control( |
| 911 |
'wpb_ea_testimonial_content_padding', |
| 912 |
array( |
| 913 |
'label' => esc_html__( 'Padding', 'wpb-elementor-addons' ), |
| 914 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 915 |
'size_units' => array( 'px' ), |
| 916 |
'selectors' => array( |
| 917 |
'{{WRAPPER}} .wpb-ea-testimonial-item .description p.testimonial-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 918 |
), |
| 919 |
) |
| 920 |
); |
| 921 |
|
| 922 |
// testimonial name style |
| 923 |
$this->add_control( |
| 924 |
'wpb_ea_testimonial_name_style', |
| 925 |
array( |
| 926 |
'label' => esc_html__( 'Name', 'wpb-elementor-addons' ), |
| 927 |
'type' => Controls_Manager::HEADING, |
| 928 |
'separator' => 'before', |
| 929 |
) |
| 930 |
); |
| 931 |
|
| 932 |
// testimonial name color |
| 933 |
$this->add_control( |
| 934 |
'wpb_ea_testimonial_name_color', |
| 935 |
array( |
| 936 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 937 |
'label' => esc_html__( 'Color', 'wpb-elementor-addons' ), |
| 938 |
'default' => '#000000', |
| 939 |
'selectors' => array( |
| 940 |
'{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-info h6.client-name' => 'color: {{VALUE}};', |
| 941 |
), |
| 942 |
) |
| 943 |
); |
| 944 |
|
| 945 |
// testimonial name typography |
| 946 |
$this->add_group_control( |
| 947 |
\Elementor\Group_Control_Typography::get_type(), |
| 948 |
array( |
| 949 |
'name' => 'wpb_ea_testimonial_name_typography', |
| 950 |
'selector' => '{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-info h6.client-name', |
| 951 |
) |
| 952 |
); |
| 953 |
|
| 954 |
// testimonial name margin |
| 955 |
$this->add_control( |
| 956 |
'wpb_ea_testimonial_name_margin', |
| 957 |
array( |
| 958 |
'label' => esc_html__( 'Margin', 'wpb-elementor-addons' ), |
| 959 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 960 |
'size_units' => array( 'px' ), |
| 961 |
'selectors' => array( |
| 962 |
'{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-info h6.client-name' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 963 |
), |
| 964 |
) |
| 965 |
); |
| 966 |
|
| 967 |
// testimonial name padding |
| 968 |
$this->add_control( |
| 969 |
'wpb_ea_testimonial_name_padding', |
| 970 |
array( |
| 971 |
'label' => esc_html__( 'Padding', 'wpb-elementor-addons' ), |
| 972 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 973 |
'size_units' => array( 'px' ), |
| 974 |
'selectors' => array( |
| 975 |
'{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-info h6.client-name' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 976 |
), |
| 977 |
) |
| 978 |
); |
| 979 |
|
| 980 |
// testimonial designation & company style |
| 981 |
$this->add_control( |
| 982 |
'wpb_ea_testimonial_desig_company_style', |
| 983 |
array( |
| 984 |
'label' => esc_html__( 'Designation and Company', 'wpb-elementor-addons' ), |
| 985 |
'type' => Controls_Manager::HEADING, |
| 986 |
'separator' => 'before', |
| 987 |
) |
| 988 |
); |
| 989 |
|
| 990 |
// testimonial designation & company color |
| 991 |
$this->add_control( |
| 992 |
'wpb_ea_testimonial_desig_company_color', |
| 993 |
array( |
| 994 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 995 |
'label' => esc_html__( 'Color', 'wpb-elementor-addons' ), |
| 996 |
'default' => '#777', |
| 997 |
'selectors' => array( |
| 998 |
'{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-info .client-desig-company' => 'color: {{VALUE}};', |
| 999 |
'{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-info .company:before' => 'background-color: {{VALUE}};', |
| 1000 |
), |
| 1001 |
) |
| 1002 |
); |
| 1003 |
|
| 1004 |
// testimonial designation & company typography |
| 1005 |
$this->add_group_control( |
| 1006 |
\Elementor\Group_Control_Typography::get_type(), |
| 1007 |
array( |
| 1008 |
'name' => 'wpb_ea_testimonial_desig_company_typography', |
| 1009 |
'selector' => '{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-info .client-desig-company', |
| 1010 |
) |
| 1011 |
); |
| 1012 |
|
| 1013 |
// testimonial designation & company margin |
| 1014 |
$this->add_control( |
| 1015 |
'wpb_ea_testimonial_desig_company_margin', |
| 1016 |
array( |
| 1017 |
'label' => esc_html__( 'Margin', 'wpb-elementor-addons' ), |
| 1018 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 1019 |
'size_units' => array( 'px' ), |
| 1020 |
'selectors' => array( |
| 1021 |
'{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-info .client-desig-company' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1022 |
), |
| 1023 |
) |
| 1024 |
); |
| 1025 |
|
| 1026 |
// testimonial designation & company padding |
| 1027 |
$this->add_control( |
| 1028 |
'wpb_ea_testimonial_desig_company_padding', |
| 1029 |
array( |
| 1030 |
'label' => esc_html__( 'Padding', 'wpb-elementor-addons' ), |
| 1031 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 1032 |
'size_units' => array( 'px' ), |
| 1033 |
'selectors' => array( |
| 1034 |
'{{WRAPPER}} .wpb-ea-testimonial-item .client-details .client-info .client-desig-company' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1035 |
), |
| 1036 |
) |
| 1037 |
); |
| 1038 |
|
| 1039 |
$this->end_controls_section(); |
| 1040 |
|
| 1041 |
/** |
| 1042 |
* ------------------------------------------- |
| 1043 |
* testimonial carousel style |
| 1044 |
* ------------------------------------------- |
| 1045 |
*/ |
| 1046 |
$this->start_controls_section( |
| 1047 |
'wpb_ea_testimonial_carousel_setting_style_options', |
| 1048 |
array( |
| 1049 |
'label' => esc_html__( 'Carousel', 'wpb-elementor-addons' ), |
| 1050 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1051 |
'condition' => array( |
| 1052 |
'.wpb_ea_testimonial.wpb_ea_testimonial_content_type' => 'slider', |
| 1053 |
), |
| 1054 |
) |
| 1055 |
); |
| 1056 |
|
| 1057 |
// navigation background color |
| 1058 |
$this->add_control( |
| 1059 |
'wpb_ea_testimonial_carousel_navigation_bg_color', |
| 1060 |
array( |
| 1061 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 1062 |
'label' => esc_html__( 'Navigation Background Color', 'wpb-elementor-addons' ), |
| 1063 |
'default' => $wpb_ea_primary_color, |
| 1064 |
'selectors' => array( |
| 1065 |
'{{WRAPPER}} .wpb-ea-testimonial-items-slider.owl-theme .owl-nav [class*=owl-]' => 'background: {{VALUE}};', |
| 1066 |
), |
| 1067 |
'condition' => array( |
| 1068 |
'.wpb_ea_testimonial_carousel_settings.arrows!' => '', |
| 1069 |
), |
| 1070 |
) |
| 1071 |
); |
| 1072 |
|
| 1073 |
// navigation color |
| 1074 |
$this->add_control( |
| 1075 |
'wpb_ea_testimonial_carousel_navigation_color', |
| 1076 |
array( |
| 1077 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 1078 |
'label' => esc_html__( 'Navigation Color', 'wpb-elementor-addons' ), |
| 1079 |
'default' => '#ffffff', |
| 1080 |
'selectors' => array( |
| 1081 |
'{{WRAPPER}} .wpb-ea-testimonial-items-slider .owl-prev .fa' => 'color: {{VALUE}};', |
| 1082 |
'{{WRAPPER}} .wpb-ea-testimonial-items-slider .owl-next .fa' => 'color: {{VALUE}};', |
| 1083 |
), |
| 1084 |
'condition' => array( |
| 1085 |
'.wpb_ea_testimonial_carousel_settings.arrows!' => '', |
| 1086 |
), |
| 1087 |
) |
| 1088 |
); |
| 1089 |
|
| 1090 |
// pagination background color |
| 1091 |
$this->add_control( |
| 1092 |
'wpb_ea_testimonial_carousel_pagination_bg_color', |
| 1093 |
array( |
| 1094 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 1095 |
'label' => esc_html__( 'Pagination Color', 'wpb-elementor-addons' ), |
| 1096 |
'default' => $wpb_ea_primary_color, |
| 1097 |
'selectors' => array( |
| 1098 |
'{{WRAPPER}} .wpb-ea-testimonial-items-slider.owl-theme .owl-dots .owl-dot span' => 'border-color: {{VALUE}}; background-color: {{VALUE}};', |
| 1099 |
), |
| 1100 |
'condition' => array( |
| 1101 |
'.wpb_ea_testimonial_carousel_settings.dots!' => '', |
| 1102 |
), |
| 1103 |
) |
| 1104 |
); |
| 1105 |
|
| 1106 |
$this->end_controls_section(); |
| 1107 |
|
| 1108 |
/** |
| 1109 |
* ------------------------------------------- |
| 1110 |
* testimonial style tab ends here |
| 1111 |
* ------------------------------------------- |
| 1112 |
*/ |
| 1113 |
} |
| 1114 |
|
| 1115 |
// render image function |
| 1116 |
private function render_image( $item, $settings ) { |
| 1117 |
$image_id = $item['image']['id']; |
| 1118 |
$image_size = $settings['image_size_size']; |
| 1119 |
if ( 'custom' === $image_size ) { |
| 1120 |
$image_src = Group_Control_Image_Size::get_attachment_image_src( $image_id, 'image_size', $settings ); |
| 1121 |
} else { |
| 1122 |
$image_src = wp_get_attachment_image_src( $image_id, $image_size ); |
| 1123 |
if ( ! empty( $image_src ) ) { |
| 1124 |
$image_src = $image_src[0]; |
| 1125 |
} |
| 1126 |
} |
| 1127 |
|
| 1128 |
return sprintf( '<img src="%s" alt="%s" />', esc_url( $image_src ), esc_html( $item['wpb_ea_testimonial_client_name'] ) ); |
| 1129 |
} |
| 1130 |
|
| 1131 |
protected function render() { |
| 1132 |
$settings = $this->get_settings_for_display(); |
| 1133 |
$extra_css = $settings['extra_css']; |
| 1134 |
if ( $extra_css ) { |
| 1135 |
$extra_css = $extra_css . ' '; |
| 1136 |
} |
| 1137 |
|
| 1138 |
// slider attributes |
| 1139 |
$stop = $settings['pause_on_hover']; |
| 1140 |
$autoplay = $settings['autoplay']; |
| 1141 |
$loop = $settings['loop']; |
| 1142 |
$slidergap = ( ! empty( $settings['slidergap']['size'] ) ? $settings['slidergap']['size'] : '' ); |
| 1143 |
$items = $settings['desktop_columns']; |
| 1144 |
$desktopsmall = $settings['small_desktop_columns']; |
| 1145 |
$tablet = $settings['tablet_display_columns']; |
| 1146 |
$mobile = $settings['mobile_display_columns']; |
| 1147 |
$navigation = $settings['arrows']; |
| 1148 |
$pagination = $settings['dots']; |
| 1149 |
$slider_attr = array( |
| 1150 |
'data-stop' => ( $stop == 'yes' ? 'true' : 'false' ), |
| 1151 |
'data-loop' => ( $loop == 'yes' ? 'true' : 'false' ), |
| 1152 |
'data-autoplay' => ( $autoplay == 'yes' ? 'true' : 'false' ), |
| 1153 |
'data-slidergap' => $slidergap, |
| 1154 |
'data-items' => $items, |
| 1155 |
'data-desktopsmall' => $desktopsmall, |
| 1156 |
'data-tablet' => $tablet, |
| 1157 |
'data-mobile' => $mobile, |
| 1158 |
'data-navigation' => ( $navigation == 'yes' ? 'true' : 'false' ), |
| 1159 |
'data-pagination' => ( $pagination == 'yes' ? 'true' : 'false' ), |
| 1160 |
'data-direction' => ( is_rtl() ? 'true' : '' ), |
| 1161 |
); |
| 1162 |
|
| 1163 |
// testimonial type grid column options |
| 1164 |
if ( $settings['wpb_ea_testimonial_content_type'] == 'grid' ) { |
| 1165 |
$grid_desktop_column = 12 / $settings['testimonial_type_grid_desktop_column']; |
| 1166 |
$grid_tablet_column = 12 / $settings['testimonial_type_grid_tablet_column']; |
| 1167 |
$grid_column = 'col-lg-' . esc_attr( $grid_desktop_column ) . ' col-md-' . esc_attr( $grid_tablet_column ); |
| 1168 |
} |
| 1169 |
if ( is_array( $settings['wpb_ea_testimonial_items'] ) ) : |
| 1170 |
echo '<div class="' . esc_attr( $extra_css ) . 'wpb-ea-testimonial-items-' . ( $settings['wpb_ea_testimonial_content_type'] == 'slider' ? 'slider owl-carousel owl-theme" ' . wp_kses_data( wpb_ea_owl_carousel_data_attr_implode( $slider_attr ) ) : 'grid ea-row"' ) . '>'; |
| 1171 |
foreach ( $settings['wpb_ea_testimonial_items'] as $item ) : |
| 1172 |
echo $settings['wpb_ea_testimonial_content_type'] == 'grid' ? '<div class="' . esc_attr( $grid_column ) . '">' : ''; |
| 1173 |
echo '<div class="wpb-ea-testimonial-item">'; |
| 1174 |
echo '<div class="description">'; |
| 1175 |
if ( $settings['wpb_ea_testimonial_quotes_icon']['value'] ) { |
| 1176 |
echo '<span class="quote">'; |
| 1177 |
\Elementor\Icons_Manager::render_icon( $settings['wpb_ea_testimonial_quotes_icon'], array( 'aria-hidden' => 'true' ) ); |
| 1178 |
echo '</span>'; |
| 1179 |
} |
| 1180 |
$item['wpb_ea_testimonial_title'] ? printf( '<h5 class="testimonial-title">%s</h5>', esc_html( $item['wpb_ea_testimonial_title'] ) ) : ''; |
| 1181 |
$item['wpb_ea_testimonial_content'] ? printf( '<p class="testimonial-content">%s</p>', wp_kses_post( $item['wpb_ea_testimonial_content'] ) ) : ''; |
| 1182 |
echo '</div>'; |
| 1183 |
echo '<div class="client-details">'; |
| 1184 |
if ( ! empty( $item['image']['url'] ) ) { |
| 1185 |
if ( ( $settings['wpb_ea_testimonial_image_lightbox_enable'] == 'yes' ) ) { |
| 1186 |
echo '<a href="' . esc_url( $item['image']['url'] ) . '" class="elementor-clickable">'; |
| 1187 |
} |
| 1188 |
echo '<div class="client-image default-border-style">'; |
| 1189 |
echo wp_kses_post( $this->render_image( $item, $settings ) ); |
| 1190 |
echo '</div>'; |
| 1191 |
if ( $settings['wpb_ea_testimonial_image_lightbox_enable'] == 'yes' ) { |
| 1192 |
echo '</a>'; |
| 1193 |
} |
| 1194 |
} |
| 1195 |
echo '<div class="client-info">'; |
| 1196 |
$item['wpb_ea_testimonial_client_name'] ? printf( '<h6 class="client-name">%s</h6>', esc_html( $item['wpb_ea_testimonial_client_name'] ) ) : ''; |
| 1197 |
echo '<div class="client-desig-company">'; |
| 1198 |
$item['wpb_ea_testimonial_client_designation'] ? printf( '<span class="designation">%s</span>', esc_html( $item['wpb_ea_testimonial_client_designation'] ) ) : ''; |
| 1199 |
$item['wpb_ea_testimonial_client_company'] ? printf( '<span class="company">%s</span>', esc_html( $item['wpb_ea_testimonial_client_company'] ) ) : ''; |
| 1200 |
echo '</div>'; |
| 1201 |
echo '</div>'; |
| 1202 |
echo '</div>'; |
| 1203 |
echo '</div>'; |
| 1204 |
echo $settings['wpb_ea_testimonial_content_type'] == 'grid' ? '</div>' : ''; |
| 1205 |
endforeach; |
| 1206 |
echo '</div>'; |
| 1207 |
endif; |
| 1208 |
} |
| 1209 |
} |
| 1210 |
|