| @@ -223,8 +223,21 @@ | ||
| 223 | 223 | return true; |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | /** |
| 227 | + * Hide on search. | |
| 228 | + * | |
| 229 | + * Whether to hide the widget on search in the panel or not. By default returns false. | |
| 230 | + * | |
| 231 | + * @access public | |
| 232 | + * | |
| 233 | + * @return bool Whether to hide the widget when searching for widget or not. | |
| 234 | + */ | |
| 235 | + public function hide_on_search() { | |
| 236 | + return false; | |
| 237 | + } | |
| 238 | + | |
| 239 | + /** | |
| 227 | 240 | * Start widget controls section. |
| 228 | 241 | * |
| 229 | 242 | * Used to add a new section of controls to the widget. Regular controls and |
| 230 | 243 | * skin controls. |
| @@ -349,8 +362,9 @@ | ||
| 349 | 362 | 'keywords' => $this->get_keywords(), |
| 350 | 363 | 'categories' => $this->get_categories(), |
| 351 | 364 | 'html_wrapper_class' => $this->get_html_wrapper_class(), |
| 352 | 365 | 'show_in_panel' => $this->show_in_panel(), |
| 366 | + 'hide_on_search' => $this->hide_on_search(), | |
| 353 | 367 | ]; |
| 354 | 368 | |
| 355 | 369 | $stack = Plugin::$instance->controls_manager->get_element_stack( $this ); |
| 356 | 370 | |
| @@ -529,10 +543,19 @@ | ||
| 529 | 543 | } |
| 530 | 544 | |
| 531 | 545 | $attributes['data-elementor-open-lightbox'] = 'yes'; |
| 532 | 546 | |
| 547 | + $action_hash_params = []; | |
| 548 | + | |
| 549 | + if ( $id ) { | |
| 550 | + $action_hash_params['id'] = $id; | |
| 551 | + $action_hash_params['url'] = wp_get_attachment_url( $id ); | |
| 552 | + } | |
| 553 | + | |
| 533 | 554 | if ( $group_id ) { |
| 534 | 555 | $attributes['data-elementor-lightbox-slideshow'] = $group_id; |
| 556 | + | |
| 557 | + $action_hash_params['slideshow'] = $group_id; | |
| 535 | 558 | } |
| 536 | 559 | |
| 537 | 560 | if ( $id ) { |
| 538 | 561 | $lightbox_image_attributes = Plugin::$instance->images_manager->get_lightbox_image_attributes( $id ); |
| @@ -544,8 +567,10 @@ | ||
| 544 | 567 | if ( isset( $lightbox_image_attributes['description'] ) ) { |
| 545 | 568 | $attributes['data-elementor-lightbox-description'] = $lightbox_image_attributes['description']; |
| 546 | 569 | } |
| 547 | 570 | } |
| 571 | + | |
| 572 | + $attributes['e-action-hash'] = Plugin::instance()->frontend->create_action_hash( 'lightbox', $action_hash_params ); | |
| 548 | 573 | |
| 549 | 574 | $this->add_render_attribute( $element, $attributes, null, $overwrite ); |
| 550 | 575 | |
| 551 | 576 | return $this; |