| 1 |
<?php |
| 2 |
|
| 3 |
namespace Borderless\Widgets; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; // Exit if accessed directly |
| 7 |
} |
| 8 |
|
| 9 |
use Elementor\Widget_Base; |
| 10 |
use Elementor\Controls_Manager; |
| 11 |
use Elementor\Group_Control_Border; |
| 12 |
use Elementor\Group_Control_Box_Shadow; |
| 13 |
use Elementor\Group_Control_Image_Size; |
| 14 |
use Elementor\Group_Control_Typography; |
| 15 |
use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 16 |
use Elementor\Group_Control_Background; |
| 17 |
use Elementor\Group_Control_Css_Filter; |
| 18 |
use Elementor\Repeater; |
| 19 |
use Elementor\Utils; |
| 20 |
|
| 21 |
class Portfolio extends Widget_Base { |
| 22 |
|
| 23 |
public function get_name() { |
| 24 |
return 'borderless-elementor-portfolio'; |
| 25 |
} |
| 26 |
|
| 27 |
public function get_title() { |
| 28 |
return esc_html__( 'Portfolio', 'borderless' ); |
| 29 |
} |
| 30 |
|
| 31 |
public function get_icon() { |
| 32 |
return 'borderless-icon-portfolio'; |
| 33 |
} |
| 34 |
|
| 35 |
public function get_categories() { |
| 36 |
return [ 'borderless' ]; |
| 37 |
} |
| 38 |
|
| 39 |
public function get_keywords() { |
| 40 |
return [ |
| 41 |
'portfolio', |
| 42 |
'portfolio gallery', |
| 43 |
'borderless portfolio', |
| 44 |
'borderless portfolio gallery', |
| 45 |
'borderless', |
| 46 |
]; |
| 47 |
} |
| 48 |
|
| 49 |
public function get_style_depends() { |
| 50 |
return [ 'elementor-widget-portfolio' ]; |
| 51 |
} |
| 52 |
|
| 53 |
public function get_script_depends() { |
| 54 |
return [ 'borderless-elementor-isotope-script' ]; |
| 55 |
} |
| 56 |
|
| 57 |
/** |
| 58 |
* Helper method to get public taxonomies |
| 59 |
*/ |
| 60 |
private function get_public_taxonomies() { |
| 61 |
$taxonomies = get_taxonomies( [ 'public' => true ], 'objects' ); |
| 62 |
$options = [ '' => __( 'Select...', 'borderless' ) ]; |
| 63 |
|
| 64 |
if ( ! empty( $taxonomies ) ) { |
| 65 |
foreach ( $taxonomies as $tax_key => $tax_value ) { |
| 66 |
$options[ $tax_key ] = $tax_value->labels->singular_name; |
| 67 |
} |
| 68 |
} |
| 69 |
|
| 70 |
return $options; |
| 71 |
} |
| 72 |
|
| 73 |
protected function register_controls() { |
| 74 |
|
| 75 |
/*-----------------------------------------------------------------------------------*/ |
| 76 |
/* *. Portfolio/Source - Content |
| 77 |
/*-----------------------------------------------------------------------------------*/ |
| 78 |
$this->start_controls_section( |
| 79 |
'borderless_elementor_section_portfolio', |
| 80 |
[ |
| 81 |
'label' => esc_html__( 'Content Source', 'borderless' ), |
| 82 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 83 |
] |
| 84 |
); |
| 85 |
|
| 86 |
$this->add_control( |
| 87 |
'borderless_elementor_portfolio_content_source', |
| 88 |
[ |
| 89 |
'label' => __( 'Content Source', 'borderless' ), |
| 90 |
'description' => __( 'Choose Query to Use Post Types or Static to Create Each Item.', 'borderless' ), |
| 91 |
'type' => Controls_Manager::SELECT, |
| 92 |
'default' => 'static', |
| 93 |
'options' => [ |
| 94 |
'static' => __( 'Static', 'borderless' ), |
| 95 |
'query' => __( 'Query', 'borderless' ), |
| 96 |
], |
| 97 |
] |
| 98 |
); |
| 99 |
|
| 100 |
$this->end_controls_section(); |
| 101 |
|
| 102 |
/*-----------------------------------------------------------------------------------*/ |
| 103 |
/* *. Portfolio/Items (Static) - Content |
| 104 |
/*-----------------------------------------------------------------------------------*/ |
| 105 |
$this->start_controls_section( |
| 106 |
'borderless_elementor_section_portfolio_items', |
| 107 |
[ |
| 108 |
'label' => esc_html__( 'Items', 'borderless' ), |
| 109 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 110 |
'condition' => [ |
| 111 |
'borderless_elementor_portfolio_content_source' => 'static', |
| 112 |
], |
| 113 |
] |
| 114 |
); |
| 115 |
|
| 116 |
$repeater = new Repeater(); |
| 117 |
|
| 118 |
$repeater->add_control( |
| 119 |
'borderless_elementor_portfolio_item_title', |
| 120 |
[ |
| 121 |
'label' => esc_html__( 'Title', 'borderless' ), |
| 122 |
'type' => Controls_Manager::TEXT, |
| 123 |
'label_block' => true, |
| 124 |
'dynamic' => [ 'active' => true ], |
| 125 |
] |
| 126 |
); |
| 127 |
|
| 128 |
$repeater->add_control( |
| 129 |
'borderless_elementor_portfolio_item_description', |
| 130 |
[ |
| 131 |
'label' => esc_html__( 'Description', 'borderless' ), |
| 132 |
'type' => Controls_Manager::TEXTAREA, |
| 133 |
'dynamic' => [ 'active' => true ], |
| 134 |
] |
| 135 |
); |
| 136 |
|
| 137 |
$repeater->add_control( |
| 138 |
'borderless_elementor_portfolio_item_image', |
| 139 |
[ |
| 140 |
'label' => __( 'Image', 'borderless' ), |
| 141 |
'type' => Controls_Manager::MEDIA, |
| 142 |
'default' => [ |
| 143 |
'url' => Utils::get_placeholder_image_src(), |
| 144 |
], |
| 145 |
'dynamic' => [ 'active' => true ], |
| 146 |
'separator' => 'before', |
| 147 |
] |
| 148 |
); |
| 149 |
|
| 150 |
$repeater->add_group_control( |
| 151 |
Group_Control_Image_Size::get_type(), |
| 152 |
[ |
| 153 |
'name' => 'borderless_elementor_portfolio_item_image', |
| 154 |
'default' => 'large', |
| 155 |
'separator' => 'none', |
| 156 |
] |
| 157 |
); |
| 158 |
|
| 159 |
$repeater->add_control( |
| 160 |
'borderless_elementor_portfolio_item_image_link', |
| 161 |
[ |
| 162 |
'label' => __( 'Image Link', 'borderless' ), |
| 163 |
'type' => Controls_Manager::SELECT, |
| 164 |
'default' => 'static', |
| 165 |
'options' => [ |
| 166 |
'none' => __( 'None', 'borderless' ), |
| 167 |
'lightbox' => __( 'Lightbox', 'borderless' ), |
| 168 |
'external' => __( 'External', 'borderless' ), |
| 169 |
], |
| 170 |
] |
| 171 |
); |
| 172 |
|
| 173 |
$repeater->add_control( |
| 174 |
'borderless_elementor_portfolio_item_button_text', |
| 175 |
[ |
| 176 |
'label' => esc_html__( 'Button Text', 'borderless' ), |
| 177 |
'type' => Controls_Manager::TEXT, |
| 178 |
'default' => esc_html__( 'View More', 'borderless' ), |
| 179 |
'dynamic' => [ 'active' => true ], |
| 180 |
'separator' => 'before', |
| 181 |
] |
| 182 |
); |
| 183 |
|
| 184 |
$repeater->add_control( |
| 185 |
'borderless_elementor_portfolio_item_button_link', |
| 186 |
[ |
| 187 |
'label' => esc_html__( 'Button Link', 'borderless' ), |
| 188 |
'type' => Controls_Manager::URL, |
| 189 |
'placeholder' => 'https://your-link.com', |
| 190 |
'default' => [ 'url' => '' ], |
| 191 |
'dynamic' => [ 'active' => true ], |
| 192 |
] |
| 193 |
); |
| 194 |
|
| 195 |
$repeater->add_control( |
| 196 |
'borderless_elementor_portfolio_item_filter', |
| 197 |
[ |
| 198 |
'label' => esc_html__( 'Filter', 'borderless' ), |
| 199 |
'description' => esc_html__( 'Enter Filter items separated by commas.', 'borderless' ), |
| 200 |
'type' => Controls_Manager::TEXTAREA, |
| 201 |
'rows' => 2, |
| 202 |
'separator' => 'before', |
| 203 |
] |
| 204 |
); |
| 205 |
|
| 206 |
$repeater->add_control( |
| 207 |
'borderless_elementor_portfolio_item_sort', |
| 208 |
[ |
| 209 |
'label' => esc_html__( 'Sort', 'borderless' ), |
| 210 |
'description' => esc_html__( 'Enter Sort items separated by commas.', 'borderless' ), |
| 211 |
'type' => Controls_Manager::TEXTAREA, |
| 212 |
'rows' => 2, |
| 213 |
] |
| 214 |
); |
| 215 |
|
| 216 |
$this->add_control( |
| 217 |
'borderless_elementor_portfolio_item_strings', |
| 218 |
[ |
| 219 |
'type' => Controls_Manager::REPEATER, |
| 220 |
'show_label' => true, |
| 221 |
'fields' => $repeater->get_controls(), |
| 222 |
'title_field' => '{{ borderless_elementor_portfolio_item_title }}', |
| 223 |
'default' => [ |
| 224 |
[], |
| 225 |
[], |
| 226 |
[], |
| 227 |
], |
| 228 |
] |
| 229 |
); |
| 230 |
|
| 231 |
$this->end_controls_section(); |
| 232 |
|
| 233 |
/*-----------------------------------------------------------------------------------*/ |
| 234 |
/* *. Portfolio/Data Source (Query) - Content |
| 235 |
/*-----------------------------------------------------------------------------------*/ |
| 236 |
$this->start_controls_section( |
| 237 |
'borderless_elementor_section_portfolio_data_source', |
| 238 |
[ |
| 239 |
'label' => esc_html__( 'Data Source', 'borderless' ), |
| 240 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 241 |
'condition' => [ |
| 242 |
'borderless_elementor_portfolio_content_source' => 'query', |
| 243 |
], |
| 244 |
] |
| 245 |
); |
| 246 |
|
| 247 |
$post_types = get_post_types( [ 'public' => true ], 'objects' ); |
| 248 |
$post_type_options = []; |
| 249 |
|
| 250 |
if ( ! empty( $post_types ) ) { |
| 251 |
foreach ( $post_types as $pt_key => $pt_value ) { |
| 252 |
$post_type_options[ $pt_key ] = $pt_value->labels->singular_name; |
| 253 |
} |
| 254 |
} |
| 255 |
|
| 256 |
$this->add_control( |
| 257 |
'borderless_elementor_portfolio_query_post_type', |
| 258 |
[ |
| 259 |
'label' => esc_html__( 'Post Type', 'borderless' ), |
| 260 |
'type' => Controls_Manager::SELECT, |
| 261 |
'default' => 'post', |
| 262 |
'options' => $post_type_options, |
| 263 |
] |
| 264 |
); |
| 265 |
|
| 266 |
$this->end_controls_section(); |
| 267 |
|
| 268 |
/*-----------------------------------------------------------------------------------*/ |
| 269 |
/* *. Portfolio/Filter - New Section |
| 270 |
/*-----------------------------------------------------------------------------------*/ |
| 271 |
$this->start_controls_section( |
| 272 |
'borderless_elementor_section_portfolio_filter_new', |
| 273 |
[ |
| 274 |
'label' => esc_html__( 'Filter', 'borderless' ), |
| 275 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 276 |
] |
| 277 |
); |
| 278 |
|
| 279 |
$this->add_control( |
| 280 |
'borderless_elementor_enable_filter', |
| 281 |
[ |
| 282 |
'label' => esc_html__( 'Enable Filter', 'borderless' ), |
| 283 |
'type' => Controls_Manager::SWITCHER, |
| 284 |
'label_on' => esc_html__( 'Yes', 'borderless' ), |
| 285 |
'label_off' => esc_html__( 'No', 'borderless' ), |
| 286 |
'return_value' => 'yes', |
| 287 |
'default' => 'yes', |
| 288 |
] |
| 289 |
); |
| 290 |
|
| 291 |
$this->add_control( |
| 292 |
'borderless_elementor_portfolio_default_filter_label', |
| 293 |
[ |
| 294 |
'label' => esc_html__( 'Default Filter Label', 'borderless' ), |
| 295 |
'type' => Controls_Manager::TEXT, |
| 296 |
'default' => 'All', |
| 297 |
'dynamic' => [ 'active' => true ], |
| 298 |
'condition' => [ |
| 299 |
'borderless_elementor_enable_filter' => 'yes', |
| 300 |
], |
| 301 |
] |
| 302 |
); |
| 303 |
|
| 304 |
$this->add_control( |
| 305 |
'borderless_elementor_portfolio_taxonomy_filter', |
| 306 |
[ |
| 307 |
'label' => esc_html__( 'Taxonomy to Filter', 'borderless' ), |
| 308 |
'type' => Controls_Manager::SELECT, |
| 309 |
'default' => '', |
| 310 |
'options' => $this->get_public_taxonomies(), |
| 311 |
'condition' => [ |
| 312 |
'borderless_elementor_portfolio_content_source' => 'query', |
| 313 |
'borderless_elementor_enable_filter' => 'yes', |
| 314 |
], |
| 315 |
'description' => __( 'Select which taxonomy should be used for the filter if in Query mode.', 'borderless' ), |
| 316 |
] |
| 317 |
); |
| 318 |
|
| 319 |
$this->end_controls_section(); |
| 320 |
|
| 321 |
/*-----------------------------------------------------------------------------------*/ |
| 322 |
/* *. Portfolio/Settings - Content |
| 323 |
/*-----------------------------------------------------------------------------------*/ |
| 324 |
$this->start_controls_section( |
| 325 |
'borderless_elementor_section_portfolio_settings', |
| 326 |
[ |
| 327 |
'label' => esc_html__( 'Settings', 'borderless' ), |
| 328 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 329 |
] |
| 330 |
); |
| 331 |
|
| 332 |
$this->add_control( |
| 333 |
'borderless_elementor_portfolio_item_columns', |
| 334 |
[ |
| 335 |
'label' => __( 'Columns', 'borderless' ), |
| 336 |
'type' => Controls_Manager::SELECT, |
| 337 |
'default' => 'borderless-cell-4@md', |
| 338 |
'options' => [ |
| 339 |
'borderless-cell-12@md' => __( '1 Column', 'borderless' ), |
| 340 |
'borderless-cell-6@md' => __( '2 Columns', 'borderless' ), |
| 341 |
'borderless-cell-4@md' => __( '3 Columns', 'borderless' ), |
| 342 |
'borderless-cell-3@md' => __( '4 Columns', 'borderless' ), |
| 343 |
'borderless-cell-2@md' => __( '6 Columns', 'borderless' ), |
| 344 |
], |
| 345 |
] |
| 346 |
); |
| 347 |
|
| 348 |
$this->end_controls_section(); |
| 349 |
|
| 350 |
/*-----------------------------------------------------------------------------------*/ |
| 351 |
/* *. General |
| 352 |
/*-----------------------------------------------------------------------------------*/ |
| 353 |
$this->start_controls_section( |
| 354 |
'borderless_elementor_section_item_style', |
| 355 |
[ |
| 356 |
'label' => esc_html__( 'General', 'borderless' ), |
| 357 |
'tab' => Controls_Manager::TAB_STYLE, |
| 358 |
] |
| 359 |
); |
| 360 |
|
| 361 |
$this->add_responsive_control( |
| 362 |
'borderless_elementor_portfolio_item_gap', |
| 363 |
[ |
| 364 |
'label' => __( 'Gap', 'borderless' ), |
| 365 |
'type' => Controls_Manager::SLIDER, |
| 366 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 367 |
'range' => [ |
| 368 |
'px' => [ |
| 369 |
'min' => 0, |
| 370 |
'max' => 100, |
| 371 |
'step' => 1, |
| 372 |
], |
| 373 |
'em' => [ |
| 374 |
'min' => 0, |
| 375 |
'max' => 10, |
| 376 |
'step' => 0.1, |
| 377 |
], |
| 378 |
'%' => [ |
| 379 |
'min' => 0, |
| 380 |
'max' => 100, |
| 381 |
], |
| 382 |
'rem' => [ |
| 383 |
'min' => 0, |
| 384 |
'max' => 10, |
| 385 |
'step' => 0.1, |
| 386 |
], |
| 387 |
], |
| 388 |
'default' => [ |
| 389 |
'unit' => 'px', |
| 390 |
'size' => 16, |
| 391 |
], |
| 392 |
'selectors' => [ |
| 393 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-inner' => 'margin: {{SIZE}}{{UNIT}};', |
| 394 |
'{{WRAPPER}} .borderless-elementor-portfolio-items' => 'margin: -{{SIZE}}{{UNIT}};', |
| 395 |
], |
| 396 |
] |
| 397 |
); |
| 398 |
|
| 399 |
$this->add_responsive_control( |
| 400 |
'borderless_elementor_portfolio_item_padding', |
| 401 |
[ |
| 402 |
'label' => esc_html__( 'Padding', 'borderless' ), |
| 403 |
'type' => Controls_Manager::DIMENSIONS, |
| 404 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 405 |
'selectors' => [ |
| 406 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 407 |
], |
| 408 |
] |
| 409 |
); |
| 410 |
|
| 411 |
$this->add_group_control( |
| 412 |
Group_Control_Border::get_type(), |
| 413 |
[ |
| 414 |
'name' => 'borderless_elementor_portfolio_item_border', |
| 415 |
'label' => esc_html__( 'Border', 'borderless' ), |
| 416 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-inner', |
| 417 |
] |
| 418 |
); |
| 419 |
|
| 420 |
$this->add_responsive_control( |
| 421 |
'borderless_elementor_portfolio_item_border_radius', |
| 422 |
[ |
| 423 |
'label' => esc_html__( 'Border Radius', 'borderless' ), |
| 424 |
'type' => Controls_Manager::DIMENSIONS, |
| 425 |
'selectors' => [ |
| 426 |
'{{WRAPPER}} .borderless-elementor-portfolio-item' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
| 427 |
], |
| 428 |
] |
| 429 |
); |
| 430 |
|
| 431 |
$this->add_group_control( |
| 432 |
Group_Control_Box_Shadow::get_type(), |
| 433 |
[ |
| 434 |
'name' => 'borderless_elementor_portfolio_item_border_box_shadow', |
| 435 |
'exclude' => [ |
| 436 |
'box_shadow_position', |
| 437 |
], |
| 438 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item', |
| 439 |
] |
| 440 |
); |
| 441 |
|
| 442 |
$this->end_controls_section(); |
| 443 |
|
| 444 |
/*-----------------------------------------------------------------------------------*/ |
| 445 |
/* *. Title |
| 446 |
/*-----------------------------------------------------------------------------------*/ |
| 447 |
$this->start_controls_section( |
| 448 |
'borderless_elementor_section_title_style', |
| 449 |
[ |
| 450 |
'label' => esc_html__( 'Title', 'borderless' ), |
| 451 |
'tab' => Controls_Manager::TAB_STYLE, |
| 452 |
] |
| 453 |
); |
| 454 |
|
| 455 |
$this->add_responsive_control( |
| 456 |
'borderless_elementor_item_content_title_align', |
| 457 |
[ |
| 458 |
'label' => __( 'Alignment', 'borderless' ), |
| 459 |
'type' => Controls_Manager::CHOOSE, |
| 460 |
'options' => [ |
| 461 |
'left' => [ |
| 462 |
'title' => __( 'Left', 'borderless' ), |
| 463 |
'icon' => 'eicon-text-align-left', |
| 464 |
], |
| 465 |
'center' => [ |
| 466 |
'title' => __( 'Center', 'borderless' ), |
| 467 |
'icon' => 'eicon-text-align-center', |
| 468 |
], |
| 469 |
'right' => [ |
| 470 |
'title' => __( 'Right', 'borderless' ), |
| 471 |
'icon' => 'eicon-text-align-right', |
| 472 |
], |
| 473 |
], |
| 474 |
'prefix_class' => 'e-grid-align-', |
| 475 |
'default' => 'center', |
| 476 |
'selectors' => [ |
| 477 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-title' => 'text-align: {{VALUE}};', |
| 478 |
], |
| 479 |
] |
| 480 |
); |
| 481 |
|
| 482 |
$this->add_control( |
| 483 |
'borderless_elementor_item_content_title_color', |
| 484 |
[ |
| 485 |
'label' => __( 'Color', 'borderless' ), |
| 486 |
'type' => Controls_Manager::COLOR, |
| 487 |
'selectors' => [ |
| 488 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-title' => 'color: {{VALUE}};', |
| 489 |
], |
| 490 |
] |
| 491 |
); |
| 492 |
|
| 493 |
$this->add_group_control( |
| 494 |
Group_Control_Typography::get_type(), |
| 495 |
[ |
| 496 |
'name' => 'borderless_elementor_item_content_title_typography', |
| 497 |
'label' => __( 'Typography', 'borderless' ), |
| 498 |
'global' => [ |
| 499 |
'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 500 |
], |
| 501 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-title', |
| 502 |
] |
| 503 |
); |
| 504 |
|
| 505 |
$this->add_responsive_control( |
| 506 |
'borderless_elementor_item_content_title_padding', |
| 507 |
[ |
| 508 |
'label' => esc_html__( 'Padding', 'borderless' ), |
| 509 |
'type' => Controls_Manager::DIMENSIONS, |
| 510 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 511 |
'selectors' => [ |
| 512 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 513 |
], |
| 514 |
] |
| 515 |
); |
| 516 |
|
| 517 |
$this->add_responsive_control( |
| 518 |
'borderless_elementor_item_content_title_margin', |
| 519 |
[ |
| 520 |
'label' => esc_html__( 'Margin', 'borderless' ), |
| 521 |
'type' => Controls_Manager::DIMENSIONS, |
| 522 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 523 |
'selectors' => [ |
| 524 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 525 |
], |
| 526 |
] |
| 527 |
); |
| 528 |
|
| 529 |
$this->end_controls_section(); |
| 530 |
|
| 531 |
/*-----------------------------------------------------------------------------------*/ |
| 532 |
/* *. Description |
| 533 |
/*-----------------------------------------------------------------------------------*/ |
| 534 |
$this->start_controls_section( |
| 535 |
'borderless_elementor_section_description_style', |
| 536 |
[ |
| 537 |
'label' => esc_html__( 'Description', 'borderless' ), |
| 538 |
'tab' => Controls_Manager::TAB_STYLE, |
| 539 |
] |
| 540 |
); |
| 541 |
|
| 542 |
$this->add_responsive_control( |
| 543 |
'borderless_elementor_item_content_description_align', |
| 544 |
[ |
| 545 |
'label' => __( 'Alignment', 'borderless' ), |
| 546 |
'type' => Controls_Manager::CHOOSE, |
| 547 |
'options' => [ |
| 548 |
'left' => [ |
| 549 |
'title' => __( 'Left', 'borderless' ), |
| 550 |
'icon' => 'eicon-text-align-left', |
| 551 |
], |
| 552 |
'center' => [ |
| 553 |
'title' => __( 'Center', 'borderless' ), |
| 554 |
'icon' => 'eicon-text-align-center', |
| 555 |
], |
| 556 |
'right' => [ |
| 557 |
'title' => __( 'Right', 'borderless' ), |
| 558 |
'icon' => 'eicon-text-align-right', |
| 559 |
], |
| 560 |
], |
| 561 |
'prefix_class' => 'e-grid-align-', |
| 562 |
'default' => 'center', |
| 563 |
'selectors' => [ |
| 564 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-description' => 'text-align: {{VALUE}};', |
| 565 |
], |
| 566 |
] |
| 567 |
); |
| 568 |
|
| 569 |
$this->add_control( |
| 570 |
'borderless_elementor_item_content_description_color', |
| 571 |
[ |
| 572 |
'label' => __( 'Color', 'borderless' ), |
| 573 |
'type' => Controls_Manager::COLOR, |
| 574 |
'selectors' => [ |
| 575 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-description' => 'color: {{VALUE}};', |
| 576 |
], |
| 577 |
] |
| 578 |
); |
| 579 |
|
| 580 |
$this->add_group_control( |
| 581 |
Group_Control_Typography::get_type(), |
| 582 |
[ |
| 583 |
'name' => 'borderless_elementor_item_content_description_typography', |
| 584 |
'label' => __( 'Typography', 'borderless' ), |
| 585 |
'global' => [ |
| 586 |
'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 587 |
], |
| 588 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-description', |
| 589 |
] |
| 590 |
); |
| 591 |
|
| 592 |
$this->add_responsive_control( |
| 593 |
'borderless_elementor_item_content_description_padding', |
| 594 |
[ |
| 595 |
'label' => esc_html__( 'Padding', 'borderless' ), |
| 596 |
'type' => Controls_Manager::DIMENSIONS, |
| 597 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 598 |
'selectors' => [ |
| 599 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 600 |
], |
| 601 |
] |
| 602 |
); |
| 603 |
|
| 604 |
$this->add_responsive_control( |
| 605 |
'borderless_elementor_item_content_description_margin', |
| 606 |
[ |
| 607 |
'label' => esc_html__( 'Margin', 'borderless' ), |
| 608 |
'type' => Controls_Manager::DIMENSIONS, |
| 609 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 610 |
'selectors' => [ |
| 611 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 612 |
], |
| 613 |
] |
| 614 |
); |
| 615 |
|
| 616 |
$this->end_controls_section(); |
| 617 |
|
| 618 |
/*-----------------------------------------------------------------------------------*/ |
| 619 |
/* *. Button |
| 620 |
/*-----------------------------------------------------------------------------------*/ |
| 621 |
$this->start_controls_section( |
| 622 |
'borderless_elementor_section_button_style', |
| 623 |
[ |
| 624 |
'label' => esc_html__( 'Button', 'borderless' ), |
| 625 |
'tab' => Controls_Manager::TAB_STYLE, |
| 626 |
] |
| 627 |
); |
| 628 |
|
| 629 |
$this->add_responsive_control( |
| 630 |
'borderless_elementor_item_content_button_alignment', |
| 631 |
[ |
| 632 |
'label' => __( 'Alignment', 'borderless' ), |
| 633 |
'type' => Controls_Manager::CHOOSE, |
| 634 |
'options' => [ |
| 635 |
'left' => [ |
| 636 |
'title' => __( 'Left', 'borderless' ), |
| 637 |
'icon' => 'eicon-text-align-left', |
| 638 |
], |
| 639 |
'center' => [ |
| 640 |
'title' => __( 'Center', 'borderless' ), |
| 641 |
'icon' => 'eicon-text-align-center', |
| 642 |
], |
| 643 |
'right' => [ |
| 644 |
'title' => __( 'Right', 'borderless' ), |
| 645 |
'icon' => 'eicon-text-align-right', |
| 646 |
], |
| 647 |
], |
| 648 |
'prefix_class' => 'e-grid-align-', |
| 649 |
'default' => 'center', |
| 650 |
'selectors' => [ |
| 651 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-button-container' => 'text-align: {{VALUE}};', |
| 652 |
], |
| 653 |
] |
| 654 |
); |
| 655 |
|
| 656 |
$this->add_responsive_control( |
| 657 |
'borderless_elementor_item_content_button_padding', |
| 658 |
[ |
| 659 |
'label' => esc_html__( 'Padding', 'borderless' ), |
| 660 |
'type' => Controls_Manager::DIMENSIONS, |
| 661 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 662 |
'selectors' => [ |
| 663 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 664 |
], |
| 665 |
] |
| 666 |
); |
| 667 |
|
| 668 |
$this->add_responsive_control( |
| 669 |
'borderless_elementor_item_content_button_margin', |
| 670 |
[ |
| 671 |
'label' => esc_html__( 'Margin', 'borderless' ), |
| 672 |
'type' => Controls_Manager::DIMENSIONS, |
| 673 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 674 |
'selectors' => [ |
| 675 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 676 |
], |
| 677 |
] |
| 678 |
); |
| 679 |
|
| 680 |
$this->start_controls_tabs( 'borderless_elementor_item_content_button_tabs' ); |
| 681 |
|
| 682 |
$this->start_controls_tab( |
| 683 |
'borderless_elementor_item_content_button_tab_normal', |
| 684 |
[ |
| 685 |
'label' => __( 'Normal', 'borderless' ), |
| 686 |
] |
| 687 |
); |
| 688 |
|
| 689 |
$this->add_control( |
| 690 |
'borderless_elementor_item_content_button_color', |
| 691 |
[ |
| 692 |
'label' => __( 'Text Color', 'borderless' ), |
| 693 |
'type' => Controls_Manager::COLOR, |
| 694 |
'selectors' => [ |
| 695 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-button' => 'color: {{VALUE}};', |
| 696 |
], |
| 697 |
] |
| 698 |
); |
| 699 |
|
| 700 |
$this->add_group_control( |
| 701 |
Group_Control_Background::get_type(), |
| 702 |
[ |
| 703 |
'name' => 'borderless_elementor_item_content_button_background', |
| 704 |
'label' => __( 'Background', 'borderless' ), |
| 705 |
'types' => [ 'classic', 'gradient' ], |
| 706 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-button', |
| 707 |
] |
| 708 |
); |
| 709 |
|
| 710 |
$this->add_group_control( |
| 711 |
Group_Control_Typography::get_type(), |
| 712 |
[ |
| 713 |
'name' => 'borderless_elementor_item_content_button_typography', |
| 714 |
'label' => __( 'Typography', 'borderless' ), |
| 715 |
'global' => [ |
| 716 |
'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 717 |
], |
| 718 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-button', |
| 719 |
] |
| 720 |
); |
| 721 |
|
| 722 |
$this->add_group_control( |
| 723 |
Group_Control_Border::get_type(), |
| 724 |
[ |
| 725 |
'name' => 'borderless_elementor_item_content_button_border', |
| 726 |
'label' => esc_html__( 'Border', 'borderless' ), |
| 727 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-button', |
| 728 |
] |
| 729 |
); |
| 730 |
|
| 731 |
$this->add_responsive_control( |
| 732 |
'borderless_elementor_item_content_button_radius', |
| 733 |
[ |
| 734 |
'label' => esc_html__( 'Border Radius', 'borderless' ), |
| 735 |
'type' => Controls_Manager::DIMENSIONS, |
| 736 |
'selectors' => [ |
| 737 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-button' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
| 738 |
], |
| 739 |
] |
| 740 |
); |
| 741 |
|
| 742 |
$this->add_group_control( |
| 743 |
Group_Control_Box_Shadow::get_type(), |
| 744 |
[ |
| 745 |
'name' => 'borderless_elementor_item_content_button_box_shadow', |
| 746 |
'exclude' => [ |
| 747 |
'box_shadow_position', |
| 748 |
], |
| 749 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-button', |
| 750 |
] |
| 751 |
); |
| 752 |
|
| 753 |
$this->end_controls_tab(); |
| 754 |
|
| 755 |
$this->start_controls_tab( |
| 756 |
'borderless_elementor_item_content_button_tab_hover', |
| 757 |
[ |
| 758 |
'label' => __( 'Hover', 'borderless' ), |
| 759 |
] |
| 760 |
); |
| 761 |
|
| 762 |
$this->add_control( |
| 763 |
'borderless_elementor_item_content_button_color_hover', |
| 764 |
[ |
| 765 |
'label' => __( 'Text Color', 'borderless' ), |
| 766 |
'type' => Controls_Manager::COLOR, |
| 767 |
'selectors' => [ |
| 768 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-button:hover' => 'color: {{VALUE}};', |
| 769 |
], |
| 770 |
] |
| 771 |
); |
| 772 |
|
| 773 |
$this->add_group_control( |
| 774 |
Group_Control_Background::get_type(), |
| 775 |
[ |
| 776 |
'name' => 'borderless_elementor_item_content_button_background_hover', |
| 777 |
'label' => __( 'Background', 'borderless' ), |
| 778 |
'types' => [ 'classic', 'gradient' ], |
| 779 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-button:hover', |
| 780 |
] |
| 781 |
); |
| 782 |
|
| 783 |
$this->add_group_control( |
| 784 |
Group_Control_Typography::get_type(), |
| 785 |
[ |
| 786 |
'name' => 'borderless_elementor_item_content_button_typography_hover', |
| 787 |
'label' => __( 'Typography', 'borderless' ), |
| 788 |
'global' => [ |
| 789 |
'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 790 |
], |
| 791 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-button:hover', |
| 792 |
] |
| 793 |
); |
| 794 |
|
| 795 |
$this->add_group_control( |
| 796 |
Group_Control_Border::get_type(), |
| 797 |
[ |
| 798 |
'name' => 'borderless_elementor_item_content_button_border_hover', |
| 799 |
'label' => esc_html__( 'Border', 'borderless' ), |
| 800 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-button:hover', |
| 801 |
] |
| 802 |
); |
| 803 |
|
| 804 |
$this->add_responsive_control( |
| 805 |
'borderless_elementor_item_content_button_radius_hover', |
| 806 |
[ |
| 807 |
'label' => esc_html__( 'Border Radius', 'borderless' ), |
| 808 |
'type' => Controls_Manager::DIMENSIONS, |
| 809 |
'selectors' => [ |
| 810 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-button:hover' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
| 811 |
], |
| 812 |
] |
| 813 |
); |
| 814 |
|
| 815 |
$this->add_group_control( |
| 816 |
Group_Control_Box_Shadow::get_type(), |
| 817 |
[ |
| 818 |
'name' => 'borderless_elementor_item_content_button_box_shadow_hover', |
| 819 |
'exclude' => [ |
| 820 |
'box_shadow_position', |
| 821 |
], |
| 822 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-button:hover', |
| 823 |
] |
| 824 |
); |
| 825 |
|
| 826 |
$this->end_controls_tab(); |
| 827 |
|
| 828 |
$this->end_controls_tabs(); |
| 829 |
|
| 830 |
$this->end_controls_section(); |
| 831 |
|
| 832 |
/*-----------------------------------------------------------------------------------*/ |
| 833 |
/* *. Image |
| 834 |
/*-----------------------------------------------------------------------------------*/ |
| 835 |
$this->start_controls_section( |
| 836 |
'borderless_elementor_section_image_style', |
| 837 |
[ |
| 838 |
'label' => esc_html__( 'Image', 'borderless' ), |
| 839 |
'tab' => Controls_Manager::TAB_STYLE, |
| 840 |
] |
| 841 |
); |
| 842 |
|
| 843 |
$this->add_group_control( |
| 844 |
Group_Control_Css_Filter::get_type(), |
| 845 |
[ |
| 846 |
'name' => 'borderless_elementor_item_content_image_css_filters', |
| 847 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-inner img', |
| 848 |
] |
| 849 |
); |
| 850 |
|
| 851 |
$this->add_control( |
| 852 |
'borderless_elementor_item_content_image_opacity', |
| 853 |
[ |
| 854 |
'label' => __( 'Opacity', 'borderless' ), |
| 855 |
'type' => Controls_Manager::SLIDER, |
| 856 |
'range' => [ |
| 857 |
'px' => [ |
| 858 |
'max' => 1, |
| 859 |
'min' => 0.10, |
| 860 |
'step' => 0.01, |
| 861 |
], |
| 862 |
], |
| 863 |
'selectors' => [ |
| 864 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-inner img' => 'opacity: {{SIZE}};', |
| 865 |
], |
| 866 |
] |
| 867 |
); |
| 868 |
|
| 869 |
$this->add_group_control( |
| 870 |
Group_Control_Border::get_type(), |
| 871 |
[ |
| 872 |
'name' => 'borderless_elementor_item_content_image_border', |
| 873 |
'label' => esc_html__( 'Border', 'borderless' ), |
| 874 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-inner img', |
| 875 |
] |
| 876 |
); |
| 877 |
|
| 878 |
$this->add_responsive_control( |
| 879 |
'borderless_elementor_item_content_image_radius', |
| 880 |
[ |
| 881 |
'label' => esc_html__( 'Border Radius', 'borderless' ), |
| 882 |
'type' => Controls_Manager::DIMENSIONS, |
| 883 |
'selectors' => [ |
| 884 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-inner img' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
| 885 |
], |
| 886 |
] |
| 887 |
); |
| 888 |
|
| 889 |
$this->add_group_control( |
| 890 |
Group_Control_Box_Shadow::get_type(), |
| 891 |
[ |
| 892 |
'name' => 'borderless_elementor_item_content_image_box_shadow', |
| 893 |
'exclude' => [ |
| 894 |
'box_shadow_position', |
| 895 |
], |
| 896 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-inner img', |
| 897 |
] |
| 898 |
); |
| 899 |
|
| 900 |
$this->end_controls_section(); |
| 901 |
|
| 902 |
/*-----------------------------------------------------------------------------------*/ |
| 903 |
/* *. Overlay |
| 904 |
/*-----------------------------------------------------------------------------------*/ |
| 905 |
$this->start_controls_section( |
| 906 |
'borderless_elementor_section_content_style', |
| 907 |
[ |
| 908 |
'label' => esc_html__( 'Overlay', 'borderless' ), |
| 909 |
'tab' => Controls_Manager::TAB_STYLE, |
| 910 |
] |
| 911 |
); |
| 912 |
|
| 913 |
$this->add_responsive_control( |
| 914 |
'borderless_elementor_item_content_vertical_alignment', |
| 915 |
[ |
| 916 |
'label' => __( 'Content Position', 'borderless' ), |
| 917 |
'type' => Controls_Manager::CHOOSE, |
| 918 |
'options' => [ |
| 919 |
'flex-start' => [ |
| 920 |
'title' => __( 'Top', 'borderless' ), |
| 921 |
'icon' => 'eicon-v-align-top', |
| 922 |
], |
| 923 |
'center' => [ |
| 924 |
'title' => __( 'Center', 'borderless' ), |
| 925 |
'icon' => 'eicon-v-align-middle', |
| 926 |
], |
| 927 |
'flex-end' => [ |
| 928 |
'title' => __( 'Bottom', 'borderless' ), |
| 929 |
'icon' => 'eicon-v-align-bottom', |
| 930 |
], |
| 931 |
], |
| 932 |
'default' => 'center', |
| 933 |
'selectors' => [ |
| 934 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-content' => 'align-content: {{VALUE}};', |
| 935 |
], |
| 936 |
] |
| 937 |
); |
| 938 |
|
| 939 |
$this->add_group_control( |
| 940 |
Group_Control_Background::get_type(), |
| 941 |
[ |
| 942 |
'name' => 'borderless_elementor_item_content_background', |
| 943 |
'label' => __( 'Background', 'borderless' ), |
| 944 |
'types' => [ 'classic', 'gradient' ], |
| 945 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-content', |
| 946 |
] |
| 947 |
); |
| 948 |
|
| 949 |
$this->add_responsive_control( |
| 950 |
'borderless_elementor_item_content_padding', |
| 951 |
[ |
| 952 |
'label' => esc_html__( 'Padding', 'borderless' ), |
| 953 |
'type' => Controls_Manager::DIMENSIONS, |
| 954 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 955 |
'selectors' => [ |
| 956 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 957 |
], |
| 958 |
] |
| 959 |
); |
| 960 |
|
| 961 |
$this->add_responsive_control( |
| 962 |
'borderless_elementor_item_content_margin', |
| 963 |
[ |
| 964 |
'label' => esc_html__( 'Margin', 'borderless' ), |
| 965 |
'type' => Controls_Manager::DIMENSIONS, |
| 966 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 967 |
'selectors' => [ |
| 968 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 969 |
], |
| 970 |
] |
| 971 |
); |
| 972 |
|
| 973 |
$this->add_group_control( |
| 974 |
Group_Control_Border::get_type(), |
| 975 |
[ |
| 976 |
'name' => 'borderless_elementor_item_content_border', |
| 977 |
'label' => esc_html__( 'Border', 'borderless' ), |
| 978 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-content', |
| 979 |
] |
| 980 |
); |
| 981 |
|
| 982 |
$this->add_responsive_control( |
| 983 |
'borderless_elementor_item_content_radius', |
| 984 |
[ |
| 985 |
'label' => esc_html__( 'Border Radius', 'borderless' ), |
| 986 |
'type' => Controls_Manager::DIMENSIONS, |
| 987 |
'selectors' => [ |
| 988 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-content' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
| 989 |
], |
| 990 |
] |
| 991 |
); |
| 992 |
|
| 993 |
$this->add_group_control( |
| 994 |
Group_Control_Box_Shadow::get_type(), |
| 995 |
[ |
| 996 |
'name' => 'borderless_elementor_item_content_box_shadow', |
| 997 |
'exclude' => [ |
| 998 |
'box_shadow_position', |
| 999 |
], |
| 1000 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-content', |
| 1001 |
] |
| 1002 |
); |
| 1003 |
|
| 1004 |
$this->end_controls_section(); |
| 1005 |
|
| 1006 |
/*-----------------------------------------------------------------------------------*/ |
| 1007 |
/* *. Filter |
| 1008 |
/*-----------------------------------------------------------------------------------*/ |
| 1009 |
$this->start_controls_section( |
| 1010 |
'borderless_elementor_section_filter_style', |
| 1011 |
[ |
| 1012 |
'label' => esc_html__( 'Filter', 'borderless' ), |
| 1013 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1014 |
] |
| 1015 |
); |
| 1016 |
|
| 1017 |
$this->add_control( |
| 1018 |
'borderless_elementor_filter_direction', |
| 1019 |
[ |
| 1020 |
'label' => esc_html__( 'Filter Layout Direction', 'borderless' ), |
| 1021 |
'type' => Controls_Manager::SELECT, |
| 1022 |
'default' => 'row', |
| 1023 |
'options' => [ |
| 1024 |
'row' => esc_html__( 'Row', 'borderless' ), |
| 1025 |
'column' => esc_html__( 'Column', 'borderless' ), |
| 1026 |
], |
| 1027 |
'selectors' => [ |
| 1028 |
'{{WRAPPER}} .borderless-elementor-portfolio-filter' => 'flex-direction: {{VALUE}};', |
| 1029 |
], |
| 1030 |
] |
| 1031 |
); |
| 1032 |
|
| 1033 |
$this->add_control( |
| 1034 |
'borderless_elementor_filter_alignment', |
| 1035 |
[ |
| 1036 |
'label' => esc_html__( 'Filter Alignment', 'borderless' ), |
| 1037 |
'type' => Controls_Manager::SELECT, |
| 1038 |
'default' => 'space-between', |
| 1039 |
'options' => [ |
| 1040 |
'flex-start' => esc_html__( 'Left/Start', 'borderless' ), |
| 1041 |
'center' => esc_html__( 'Center', 'borderless' ), |
| 1042 |
'flex-end' => esc_html__( 'Right/End', 'borderless' ), |
| 1043 |
'space-between' => esc_html__( 'Space Between', 'borderless' ), |
| 1044 |
'space-around' => esc_html__( 'Space Around', 'borderless' ), |
| 1045 |
], |
| 1046 |
'selectors' => [ |
| 1047 |
'{{WRAPPER}} .borderless-elementor-portfolio-filter' => 'justify-content: {{VALUE}};', |
| 1048 |
], |
| 1049 |
] |
| 1050 |
); |
| 1051 |
|
| 1052 |
$this->add_responsive_control( |
| 1053 |
'borderless_elementor_filter_padding_general', |
| 1054 |
[ |
| 1055 |
'label' => esc_html__( 'Padding', 'borderless' ), |
| 1056 |
'type' => Controls_Manager::DIMENSIONS, |
| 1057 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 1058 |
'selectors' => [ |
| 1059 |
'{{WRAPPER}} .borderless-elementor-portfolio-filter' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1060 |
], |
| 1061 |
] |
| 1062 |
); |
| 1063 |
|
| 1064 |
$this->add_responsive_control( |
| 1065 |
'borderless_elementor_filter_margin_general', |
| 1066 |
[ |
| 1067 |
'label' => esc_html__( 'Margin', 'borderless' ), |
| 1068 |
'type' => Controls_Manager::DIMENSIONS, |
| 1069 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 1070 |
'selectors' => [ |
| 1071 |
'{{WRAPPER}} .borderless-elementor-portfolio-filter' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1072 |
], |
| 1073 |
] |
| 1074 |
); |
| 1075 |
|
| 1076 |
$this->end_controls_section(); |
| 1077 |
|
| 1078 |
/*-----------------------------------------------------------------------------------*/ |
| 1079 |
/* *. Filter Item |
| 1080 |
/*-----------------------------------------------------------------------------------*/ |
| 1081 |
$this->start_controls_section( |
| 1082 |
'borderless_elementor_section_filter_item_style', |
| 1083 |
[ |
| 1084 |
'label' => esc_html__( 'Filter Item', 'borderless' ), |
| 1085 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1086 |
] |
| 1087 |
); |
| 1088 |
|
| 1089 |
// Controle de tipografia (fora das tabs) |
| 1090 |
$this->add_group_control( |
| 1091 |
Group_Control_Typography::get_type(), |
| 1092 |
[ |
| 1093 |
'name' => 'borderless_elementor_filter_typography', |
| 1094 |
'label' => esc_html__( 'Typography', 'borderless' ), |
| 1095 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-filter-item-title', |
| 1096 |
] |
| 1097 |
); |
| 1098 |
|
| 1099 |
// Início das tabs Normal/Hover |
| 1100 |
$this->start_controls_tabs( 'filter_item_tabs' ); |
| 1101 |
|
| 1102 |
// Tab Normal |
| 1103 |
$this->start_controls_tab( |
| 1104 |
'filter_item_normal_tab', |
| 1105 |
[ |
| 1106 |
'label' => __( 'Normal', 'borderless' ), |
| 1107 |
] |
| 1108 |
); |
| 1109 |
|
| 1110 |
$this->add_control( |
| 1111 |
'borderless_elementor_filter_text_color_normal', |
| 1112 |
[ |
| 1113 |
'label' => __( 'Text Color', 'borderless' ), |
| 1114 |
'type' => Controls_Manager::COLOR, |
| 1115 |
'default' => '', |
| 1116 |
'selectors' => [ |
| 1117 |
'{{WRAPPER}} .borderless-elementor-portfolio-filter-item-title' => 'color: {{VALUE}};', |
| 1118 |
], |
| 1119 |
] |
| 1120 |
); |
| 1121 |
|
| 1122 |
$this->add_group_control( |
| 1123 |
Group_Control_Background::get_type(), |
| 1124 |
[ |
| 1125 |
'name' => 'borderless_elementor_filter_background_normal', |
| 1126 |
'label' => __( 'Background', 'borderless' ), |
| 1127 |
'types' => [ 'classic', 'gradient' ], |
| 1128 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-filter-item', |
| 1129 |
] |
| 1130 |
); |
| 1131 |
|
| 1132 |
$this->end_controls_tab(); |
| 1133 |
|
| 1134 |
// Tab Hover |
| 1135 |
$this->start_controls_tab( |
| 1136 |
'filter_item_hover_tab', |
| 1137 |
[ |
| 1138 |
'label' => __( 'Hover', 'borderless' ), |
| 1139 |
] |
| 1140 |
); |
| 1141 |
|
| 1142 |
$this->add_control( |
| 1143 |
'borderless_elementor_filter_text_color_hover', |
| 1144 |
[ |
| 1145 |
'label' => __( 'Text Color', 'borderless' ), |
| 1146 |
'type' => Controls_Manager::COLOR, |
| 1147 |
'default' => '', |
| 1148 |
'selectors' => [ |
| 1149 |
'{{WRAPPER}} .borderless-elementor-portfolio-filter-item-title:hover' => 'color: {{VALUE}};', |
| 1150 |
], |
| 1151 |
] |
| 1152 |
); |
| 1153 |
|
| 1154 |
$this->add_group_control( |
| 1155 |
Group_Control_Background::get_type(), |
| 1156 |
[ |
| 1157 |
'name' => 'borderless_elementor_filter_background_hover', |
| 1158 |
'label' => __( 'Background', 'borderless' ), |
| 1159 |
'types' => [ 'classic', 'gradient' ], |
| 1160 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-filter-item:hover', |
| 1161 |
] |
| 1162 |
); |
| 1163 |
|
| 1164 |
$this->add_control( |
| 1165 |
'borderless_elementor_filter_border_color_hover', |
| 1166 |
[ |
| 1167 |
'label' => __( 'Border Color', 'borderless' ), |
| 1168 |
'type' => Controls_Manager::COLOR, |
| 1169 |
'default' => '', |
| 1170 |
'selectors' => [ |
| 1171 |
'{{WRAPPER}} .borderless-elementor-portfolio-filter-item:hover' => 'border-color: {{VALUE}};', |
| 1172 |
], |
| 1173 |
] |
| 1174 |
); |
| 1175 |
|
| 1176 |
$this->end_controls_tab(); |
| 1177 |
|
| 1178 |
$this->end_controls_tabs(); |
| 1179 |
|
| 1180 |
// Restante dos controles para Filter Item |
| 1181 |
$this->add_group_control( |
| 1182 |
Group_Control_Border::get_type(), |
| 1183 |
[ |
| 1184 |
'name' => 'borderless_elementor_filter_border', |
| 1185 |
'label' => esc_html__( 'Border', 'borderless' ), |
| 1186 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-filter-item', |
| 1187 |
] |
| 1188 |
); |
| 1189 |
|
| 1190 |
$this->add_responsive_control( |
| 1191 |
'borderless_elementor_filter_border_radius', |
| 1192 |
[ |
| 1193 |
'label' => esc_html__( 'Border Radius', 'borderless' ), |
| 1194 |
'type' => Controls_Manager::DIMENSIONS, |
| 1195 |
'size_units' => [ 'px', 'em', '%' ], |
| 1196 |
'selectors' => [ |
| 1197 |
'{{WRAPPER}} .borderless-elementor-portfolio-filter-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1198 |
], |
| 1199 |
] |
| 1200 |
); |
| 1201 |
|
| 1202 |
$this->add_group_control( |
| 1203 |
Group_Control_Box_Shadow::get_type(), |
| 1204 |
[ |
| 1205 |
'name' => 'borderless_elementor_filter_box_shadow', |
| 1206 |
'label' => esc_html__( 'Box Shadow', 'borderless' ), |
| 1207 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-filter-item', |
| 1208 |
] |
| 1209 |
); |
| 1210 |
|
| 1211 |
$this->add_responsive_control( |
| 1212 |
'borderless_elementor_filter_padding', |
| 1213 |
[ |
| 1214 |
'label' => esc_html__( 'Padding', 'borderless' ), |
| 1215 |
'type' => Controls_Manager::DIMENSIONS, |
| 1216 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 1217 |
'selectors' => [ |
| 1218 |
'{{WRAPPER}} .borderless-elementor-portfolio-filter-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1219 |
], |
| 1220 |
] |
| 1221 |
); |
| 1222 |
|
| 1223 |
$this->add_responsive_control( |
| 1224 |
'borderless_elementor_filter_margin_item', |
| 1225 |
[ |
| 1226 |
'label' => esc_html__( 'Margin', 'borderless' ), |
| 1227 |
'type' => Controls_Manager::DIMENSIONS, |
| 1228 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 1229 |
'selectors' => [ |
| 1230 |
'{{WRAPPER}} .borderless-elementor-portfolio-filter-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1231 |
], |
| 1232 |
] |
| 1233 |
); |
| 1234 |
|
| 1235 |
$this->end_controls_section(); |
| 1236 |
|
| 1237 |
$this->end_controls_tabs(); |
| 1238 |
|
| 1239 |
$this->end_controls_section(); |
| 1240 |
|
| 1241 |
/*-----------------------------------------------------------------------------------*/ |
| 1242 |
/* *. Image |
| 1243 |
/*-----------------------------------------------------------------------------------*/ |
| 1244 |
$this->start_controls_section( |
| 1245 |
'borderless_elementor_section_image_style', |
| 1246 |
[ |
| 1247 |
'label' => esc_html__( 'Image', 'borderless' ), |
| 1248 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1249 |
] |
| 1250 |
); |
| 1251 |
|
| 1252 |
$this->add_group_control( |
| 1253 |
Group_Control_Css_Filter::get_type(), |
| 1254 |
[ |
| 1255 |
'name' => 'borderless_elementor_item_content_image_css_filters', |
| 1256 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-inner img', |
| 1257 |
] |
| 1258 |
); |
| 1259 |
|
| 1260 |
$this->add_control( |
| 1261 |
'borderless_elementor_item_content_image_opacity', |
| 1262 |
[ |
| 1263 |
'label' => __( 'Opacity', 'borderless' ), |
| 1264 |
'type' => Controls_Manager::SLIDER, |
| 1265 |
'range' => [ |
| 1266 |
'px' => [ |
| 1267 |
'max' => 1, |
| 1268 |
'min' => 0.10, |
| 1269 |
'step' => 0.01, |
| 1270 |
], |
| 1271 |
], |
| 1272 |
'selectors' => [ |
| 1273 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-inner img' => 'opacity: {{SIZE}};', |
| 1274 |
], |
| 1275 |
] |
| 1276 |
); |
| 1277 |
|
| 1278 |
$this->add_group_control( |
| 1279 |
Group_Control_Border::get_type(), |
| 1280 |
[ |
| 1281 |
'name' => 'borderless_elementor_item_content_image_border', |
| 1282 |
'label' => esc_html__( 'Border', 'borderless' ), |
| 1283 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-inner img', |
| 1284 |
] |
| 1285 |
); |
| 1286 |
|
| 1287 |
$this->add_responsive_control( |
| 1288 |
'borderless_elementor_item_content_image_radius', |
| 1289 |
[ |
| 1290 |
'label' => esc_html__( 'Border Radius', 'borderless' ), |
| 1291 |
'type' => Controls_Manager::DIMENSIONS, |
| 1292 |
'selectors' => [ |
| 1293 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-inner img' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
| 1294 |
], |
| 1295 |
] |
| 1296 |
); |
| 1297 |
|
| 1298 |
$this->add_group_control( |
| 1299 |
Group_Control_Box_Shadow::get_type(), |
| 1300 |
[ |
| 1301 |
'name' => 'borderless_elementor_item_content_image_box_shadow', |
| 1302 |
'exclude' => [ |
| 1303 |
'box_shadow_position', |
| 1304 |
], |
| 1305 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-inner img', |
| 1306 |
] |
| 1307 |
); |
| 1308 |
|
| 1309 |
$this->end_controls_section(); |
| 1310 |
|
| 1311 |
/*-----------------------------------------------------------------------------------*/ |
| 1312 |
/* *. Overlay |
| 1313 |
/*-----------------------------------------------------------------------------------*/ |
| 1314 |
$this->start_controls_section( |
| 1315 |
'borderless_elementor_section_content_style', |
| 1316 |
[ |
| 1317 |
'label' => esc_html__( 'Overlay', 'borderless' ), |
| 1318 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1319 |
] |
| 1320 |
); |
| 1321 |
|
| 1322 |
$this->add_responsive_control( |
| 1323 |
'borderless_elementor_item_content_vertical_alignment', |
| 1324 |
[ |
| 1325 |
'label' => __( 'Content Position', 'borderless' ), |
| 1326 |
'type' => Controls_Manager::CHOOSE, |
| 1327 |
'options' => [ |
| 1328 |
'flex-start' => [ |
| 1329 |
'title' => __( 'Top', 'borderless' ), |
| 1330 |
'icon' => 'eicon-v-align-top', |
| 1331 |
], |
| 1332 |
'center' => [ |
| 1333 |
'title' => __( 'Center', 'borderless' ), |
| 1334 |
'icon' => 'eicon-v-align-middle', |
| 1335 |
], |
| 1336 |
'flex-end' => [ |
| 1337 |
'title' => __( 'Bottom', 'borderless' ), |
| 1338 |
'icon' => 'eicon-v-align-bottom', |
| 1339 |
], |
| 1340 |
], |
| 1341 |
'default' => 'center', |
| 1342 |
'selectors' => [ |
| 1343 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-content' => 'align-content: {{VALUE}};', |
| 1344 |
], |
| 1345 |
] |
| 1346 |
); |
| 1347 |
|
| 1348 |
$this->add_group_control( |
| 1349 |
Group_Control_Background::get_type(), |
| 1350 |
[ |
| 1351 |
'name' => 'borderless_elementor_item_content_background', |
| 1352 |
'label' => __( 'Background', 'borderless' ), |
| 1353 |
'types' => [ 'classic', 'gradient' ], |
| 1354 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-content', |
| 1355 |
] |
| 1356 |
); |
| 1357 |
|
| 1358 |
$this->add_responsive_control( |
| 1359 |
'borderless_elementor_item_content_padding', |
| 1360 |
[ |
| 1361 |
'label' => esc_html__( 'Padding', 'borderless' ), |
| 1362 |
'type' => Controls_Manager::DIMENSIONS, |
| 1363 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 1364 |
'selectors' => [ |
| 1365 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1366 |
], |
| 1367 |
] |
| 1368 |
); |
| 1369 |
|
| 1370 |
$this->add_responsive_control( |
| 1371 |
'borderless_elementor_item_content_margin', |
| 1372 |
[ |
| 1373 |
'label' => esc_html__( 'Margin', 'borderless' ), |
| 1374 |
'type' => Controls_Manager::DIMENSIONS, |
| 1375 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 1376 |
'selectors' => [ |
| 1377 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1378 |
], |
| 1379 |
] |
| 1380 |
); |
| 1381 |
|
| 1382 |
$this->add_group_control( |
| 1383 |
Group_Control_Border::get_type(), |
| 1384 |
[ |
| 1385 |
'name' => 'borderless_elementor_item_content_border', |
| 1386 |
'label' => esc_html__( 'Border', 'borderless' ), |
| 1387 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-content', |
| 1388 |
] |
| 1389 |
); |
| 1390 |
|
| 1391 |
$this->add_responsive_control( |
| 1392 |
'borderless_elementor_item_content_radius', |
| 1393 |
[ |
| 1394 |
'label' => esc_html__( 'Border Radius', 'borderless' ), |
| 1395 |
'type' => Controls_Manager::DIMENSIONS, |
| 1396 |
'selectors' => [ |
| 1397 |
'{{WRAPPER}} .borderless-elementor-portfolio-item-content' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
| 1398 |
], |
| 1399 |
] |
| 1400 |
); |
| 1401 |
|
| 1402 |
$this->add_group_control( |
| 1403 |
Group_Control_Box_Shadow::get_type(), |
| 1404 |
[ |
| 1405 |
'name' => 'borderless_elementor_item_content_box_shadow', |
| 1406 |
'exclude' => [ |
| 1407 |
'box_shadow_position', |
| 1408 |
], |
| 1409 |
'selector' => '{{WRAPPER}} .borderless-elementor-portfolio-item-content', |
| 1410 |
] |
| 1411 |
); |
| 1412 |
|
| 1413 |
$this->end_controls_section(); |
| 1414 |
|
| 1415 |
} |
| 1416 |
|
| 1417 |
protected function render() { |
| 1418 |
|
| 1419 |
$settings = $this->get_settings_for_display(); |
| 1420 |
|
| 1421 |
$target = isset( $settings['borderless_elementor_portfolio_item_button_link']['is_external'] ) && $settings['borderless_elementor_portfolio_item_button_link']['is_external'] ? ' target="_blank"' : ''; |
| 1422 |
$nofollow = isset( $settings['borderless_elementor_portfolio_item_button_link']['nofollow'] ) && $settings['borderless_elementor_portfolio_item_button_link']['nofollow'] ? ' rel="nofollow"' : ''; |
| 1423 |
|
| 1424 |
/** |
| 1425 |
* QUERY MODE |
| 1426 |
*/ |
| 1427 |
if ( 'query' === $settings['borderless_elementor_portfolio_content_source'] ) { |
| 1428 |
|
| 1429 |
$post_type_chosen = ! empty( $settings['borderless_elementor_portfolio_query_post_type'] ) |
| 1430 |
? $settings['borderless_elementor_portfolio_query_post_type'] |
| 1431 |
: 'post'; |
| 1432 |
|
| 1433 |
$args = [ |
| 1434 |
'post_type' => $post_type_chosen, |
| 1435 |
'posts_per_page' => -1, |
| 1436 |
]; |
| 1437 |
|
| 1438 |
$wp_query = new \WP_Query( $args ); |
| 1439 |
|
| 1440 |
if ( $wp_query->have_posts() ) { |
| 1441 |
?> |
| 1442 |
<div class="borderless-elementor-portfolio-widget"> |
| 1443 |
<div class="borderless-elementor-portfolio borderless-container" data-portfolio-gutter="<?php echo esc_attr( $settings['borderless_elementor_portfolio_item_gap']['size'] ); ?>"> |
| 1444 |
<?php |
| 1445 |
// Render the filter only if enabled. |
| 1446 |
if ( 'yes' === $settings['borderless_elementor_enable_filter'] ) { |
| 1447 |
?> |
| 1448 |
<div class="borderless-elementor-portfolio-filters"> |
| 1449 |
<div class="borderless-elementor-portfolio-filter" data-portfolio-filter-group="filter"> |
| 1450 |
<div class="borderless-elementor-portfolio-filter-item is-checked" data-portfolio-filter=""> |
| 1451 |
<span class="borderless-elementor-portfolio-filter-item-title"><?php echo esc_html( $settings['borderless_elementor_portfolio_default_filter_label'] ); ?></span> |
| 1452 |
</div> |
| 1453 |
<?php |
| 1454 |
if ( ! empty( $settings['borderless_elementor_portfolio_taxonomy_filter'] ) ) { |
| 1455 |
$tax = $settings['borderless_elementor_portfolio_taxonomy_filter']; |
| 1456 |
$terms = get_terms( [ |
| 1457 |
'taxonomy' => $tax, |
| 1458 |
'hide_empty' => true, |
| 1459 |
] ); |
| 1460 |
|
| 1461 |
if ( ! is_wp_error( $terms ) && ! empty( $terms ) ) { |
| 1462 |
foreach ( $terms as $term ) { |
| 1463 |
$term_slug_class = strtolower( str_replace( ' ', '', $term->slug ) ); |
| 1464 |
?> |
| 1465 |
<div class="borderless-elementor-portfolio-filter-item" data-portfolio-filter=".<?php echo esc_attr( $term_slug_class ); ?>"> |
| 1466 |
<span class="borderless-elementor-portfolio-filter-item-title"><?php echo esc_html( $term->name ); ?></span> |
| 1467 |
</div> |
| 1468 |
<?php |
| 1469 |
} |
| 1470 |
} |
| 1471 |
} |
| 1472 |
?> |
| 1473 |
</div> |
| 1474 |
</div><!-- .borderless-elementor-portfolio-filters --> |
| 1475 |
<?php |
| 1476 |
} |
| 1477 |
?> |
| 1478 |
<div class="borderless-elementor-portfolio-items borderless-grid"> |
| 1479 |
<?php |
| 1480 |
while ( $wp_query->have_posts() ) { |
| 1481 |
$wp_query->the_post(); |
| 1482 |
|
| 1483 |
$taxonomy_classes = ''; |
| 1484 |
if ( ! empty( $settings['borderless_elementor_portfolio_taxonomy_filter'] ) ) { |
| 1485 |
$selected_tax = $settings['borderless_elementor_portfolio_taxonomy_filter']; |
| 1486 |
$post_terms = get_the_terms( get_the_ID(), $selected_tax ); |
| 1487 |
|
| 1488 |
if ( ! empty( $post_terms ) && ! is_wp_error( $post_terms ) ) { |
| 1489 |
foreach ( $post_terms as $pt ) { |
| 1490 |
$taxonomy_classes .= ' ' . strtolower( str_replace( ' ', '', $pt->slug ) ); |
| 1491 |
} |
| 1492 |
} |
| 1493 |
} |
| 1494 |
?> |
| 1495 |
<div class="borderless-elementor-portfolio-item <?php echo esc_attr( $settings['borderless_elementor_portfolio_item_columns'] . $taxonomy_classes ); ?>"> |
| 1496 |
<div class="borderless-elementor-portfolio-item-inner"> |
| 1497 |
<?php |
| 1498 |
if ( has_post_thumbnail() ) { |
| 1499 |
the_post_thumbnail( 'large' ); |
| 1500 |
} else { |
| 1501 |
echo '<img src="' . esc_url( Utils::get_placeholder_image_src() ) . '" alt="' . esc_attr( get_the_title() ) . '">'; |
| 1502 |
} |
| 1503 |
?> |
| 1504 |
<div class="borderless-elementor-portfolio-item-content"> |
| 1505 |
<div class="borderless-elementor-portfolio-item-content-inner"> |
| 1506 |
<h2 class="borderless-elementor-portfolio-item-title"><?php the_title(); ?></h2> |
| 1507 |
<div class="borderless-elementor-portfolio-item-button-container"> |
| 1508 |
<a class="borderless-elementor-portfolio-item-button borderless-btn borderless-btn--primary" href="<?php the_permalink(); ?>"> |
| 1509 |
<?php esc_html_e( 'Read More', 'borderless' ); ?> |
| 1510 |
</a> |
| 1511 |
</div> |
| 1512 |
</div><!-- .borderless-elementor-portfolio-item-content-inner --> |
| 1513 |
</div><!-- .borderless-elementor-portfolio-item-content --> |
| 1514 |
</div><!-- .borderless-elementor-portfolio-item-inner --> |
| 1515 |
</div><!-- .borderless-elementor-portfolio-item --> |
| 1516 |
<?php |
| 1517 |
} |
| 1518 |
?> |
| 1519 |
</div><!-- .borderless-elementor-portfolio-items --> |
| 1520 |
</div><!-- .borderless-elementor-portfolio --> |
| 1521 |
</div><!-- .borderless-elementor-portfolio-widget --> |
| 1522 |
<?php |
| 1523 |
} |
| 1524 |
wp_reset_postdata(); |
| 1525 |
return; |
| 1526 |
} |
| 1527 |
|
| 1528 |
/** |
| 1529 |
* STATIC MODE |
| 1530 |
*/ |
| 1531 |
if ( ! empty( $settings['borderless_elementor_portfolio_item_strings'] ) ) { |
| 1532 |
$filter_title_items = []; |
| 1533 |
$filter_classe_items = []; |
| 1534 |
foreach ( $settings['borderless_elementor_portfolio_item_strings'] as $portfolio_string ) { |
| 1535 |
$filters = explode( ',', $portfolio_string['borderless_elementor_portfolio_item_filter'] ); |
| 1536 |
$filters = array_map( 'trim', $filters ); |
| 1537 |
foreach ( $filters as $filter_title ) { |
| 1538 |
$filter_title_items[] = $filter_title; |
| 1539 |
} |
| 1540 |
foreach ( $filters as $filter_classe ) { |
| 1541 |
$filter_classe_items[] = strtolower( str_replace( ' ', '', $filter_classe ) ); |
| 1542 |
} |
| 1543 |
} |
| 1544 |
$filter_title_items = array_unique( $filter_title_items ); |
| 1545 |
$filter_classe_items = array_unique( $filter_classe_items ); |
| 1546 |
?> |
| 1547 |
<div class="borderless-elementor-portfolio-widget"> |
| 1548 |
<div class="borderless-elementor-portfolio borderless-container" data-portfolio-gutter="<?php echo esc_attr( $settings['borderless_elementor_portfolio_item_gap']['size'] ); ?>"> |
| 1549 |
<?php |
| 1550 |
// Render filter block only if enabled. |
| 1551 |
if ( 'yes' === $settings['borderless_elementor_enable_filter'] ) { |
| 1552 |
?> |
| 1553 |
<div class="borderless-elementor-portfolio-filters"> |
| 1554 |
<div class="borderless-elementor-portfolio-filter" data-portfolio-filter-group="filter"> |
| 1555 |
<div class="borderless-elementor-portfolio-filter-item is-checked" data-portfolio-filter=""> |
| 1556 |
<span class="borderless-elementor-portfolio-filter-item-title"><?php echo esc_html( $settings['borderless_elementor_portfolio_default_filter_label'] ); ?></span> |
| 1557 |
</div> |
| 1558 |
<?php |
| 1559 |
if ( ! empty( $settings['borderless_elementor_portfolio_item_strings'] ) ) { |
| 1560 |
foreach ( array_combine( $filter_title_items, $filter_classe_items ) as $filter_title_item => $filter_classe_item ) { |
| 1561 |
?> |
| 1562 |
<div class="borderless-elementor-portfolio-filter-item" data-portfolio-filter=".<?php echo esc_attr( $filter_classe_item ); ?>"> |
| 1563 |
<span class="borderless-elementor-portfolio-filter-item-title"><?php echo esc_html( $filter_title_item ); ?></span> |
| 1564 |
</div> |
| 1565 |
<?php |
| 1566 |
} |
| 1567 |
} |
| 1568 |
?> |
| 1569 |
</div> |
| 1570 |
</div><!-- .borderless-elementor-portfolio-filters --> |
| 1571 |
<?php |
| 1572 |
} |
| 1573 |
?> |
| 1574 |
<div class="borderless-elementor-portfolio-items borderless-grid"> |
| 1575 |
<?php |
| 1576 |
foreach ( $settings['borderless_elementor_portfolio_item_strings'] as $portfolio_string ) { |
| 1577 |
$filter = strtolower( str_replace( ',', ' ', $portfolio_string['borderless_elementor_portfolio_item_filter'] ) ); |
| 1578 |
$filter = strtolower( str_replace( ' ', '', $filter ) ); |
| 1579 |
?> |
| 1580 |
<div class="borderless-elementor-portfolio-item <?php echo esc_attr( $settings['borderless_elementor_portfolio_item_columns'] . ' ' . $filter ); ?>"> |
| 1581 |
<div class="borderless-elementor-portfolio-item-inner"> |
| 1582 |
<img src="<?php echo esc_url( $portfolio_string['borderless_elementor_portfolio_item_image']['url'] ); ?>" alt=""> |
| 1583 |
<div class="borderless-elementor-portfolio-item-content"> |
| 1584 |
<div class="borderless-elementor-portfolio-item-content-inner"> |
| 1585 |
<h2 class="borderless-elementor-portfolio-item-title"><?php echo wp_kses( $portfolio_string['borderless_elementor_portfolio_item_title'], [] ); ?></h2> |
| 1586 |
<span class="borderless-elementor-portfolio-item-description"><?php echo wp_kses( $portfolio_string['borderless_elementor_portfolio_item_description'], [] ); ?></span> |
| 1587 |
<div class="borderless-elementor-portfolio-item-button-container"> |
| 1588 |
<a class="borderless-elementor-portfolio-item-button borderless-btn borderless-btn--primary" href="<?php echo esc_url( $portfolio_string['borderless_elementor_portfolio_item_button_link']['url'] ); ?>" <?php echo $target . $nofollow; ?>> |
| 1589 |
<?php echo wp_kses( $portfolio_string['borderless_elementor_portfolio_item_button_text'], [] ); ?> |
| 1590 |
</a> |
| 1591 |
</div> |
| 1592 |
</div><!-- .borderless-elementor-portfolio-item-content-inner --> |
| 1593 |
</div><!-- .borderless-elementor-portfolio-item-content --> |
| 1594 |
</div><!-- .borderless-elementor-portfolio-item-inner --> |
| 1595 |
</div><!-- .borderless-elementor-portfolio-item --> |
| 1596 |
<?php |
| 1597 |
} |
| 1598 |
?> |
| 1599 |
</div><!-- .borderless-elementor-portfolio-items --> |
| 1600 |
</div><!-- .borderless-elementor-portfolio --> |
| 1601 |
</div><!-- .borderless-elementor-portfolio-widget --> |
| 1602 |
<?php |
| 1603 |
} |
| 1604 |
} |
| 1605 |
|
| 1606 |
protected function content_template() {} |
| 1607 |
} |
| 1608 |
|