| 1 |
<?php |
| 2 |
/** |
| 3 |
* Elementor Property Images Widget. |
| 4 |
* |
| 5 |
* @since 1.0.0 |
| 6 |
*/ |
| 7 |
class Elementor_Property_Images_Widget extends \Elementor\Widget_Base { |
| 8 |
|
| 9 |
public function get_name() { |
| 10 |
return 'property-images'; |
| 11 |
} |
| 12 |
|
| 13 |
public function get_title() { |
| 14 |
return __( 'Images', 'propertyhive' ); |
| 15 |
} |
| 16 |
|
| 17 |
public function get_icon() { |
| 18 |
return 'fa fa-images'; |
| 19 |
} |
| 20 |
|
| 21 |
public function get_categories() { |
| 22 |
return [ 'property-hive' ]; |
| 23 |
} |
| 24 |
|
| 25 |
public function get_keywords() { |
| 26 |
return [ 'property hive', 'propertyhive', 'property', 'images', 'photos', 'gallery', 'slideshow' ]; |
| 27 |
} |
| 28 |
|
| 29 |
protected function _register_controls() { |
| 30 |
|
| 31 |
$this->start_controls_section( |
| 32 |
'content_section', |
| 33 |
[ |
| 34 |
'label' => __( 'Images', 'plugin-name' ), |
| 35 |
'tab' => \Elementor\Controls_Manager::TAB_CONTENT, |
| 36 |
] |
| 37 |
); |
| 38 |
|
| 39 |
|
| 40 |
$this->end_controls_section(); |
| 41 |
|
| 42 |
} |
| 43 |
|
| 44 |
protected function render() { |
| 45 |
|
| 46 |
global $property; |
| 47 |
|
| 48 |
$settings = $this->get_settings_for_display(); |
| 49 |
|
| 50 |
if ( !isset($property->id) ) { |
| 51 |
return; |
| 52 |
} |
| 53 |
|
| 54 |
propertyhive_show_property_images(); |
| 55 |
|
| 56 |
// On render widget from Editor - trigger the init manually. |
| 57 |
if ( wp_doing_ajax() ) { |
| 58 |
?> |
| 59 |
<script> |
| 60 |
// The slider being synced must be initialized first |
| 61 |
//ph_init_slideshow(); |
| 62 |
</script> |
| 63 |
<?php |
| 64 |
} |
| 65 |
|
| 66 |
} |
| 67 |
|
| 68 |
} |