| 1 |
<?php |
| 2 |
/** |
| 3 |
* Elementor Property Meta Widget. |
| 4 |
* |
| 5 |
* @since 1.0.0 |
| 6 |
*/ |
| 7 |
class Elementor_Property_Meta_Widget extends \Elementor\Widget_Base { |
| 8 |
|
| 9 |
public function get_name() { |
| 10 |
return 'property-meta'; |
| 11 |
} |
| 12 |
|
| 13 |
public function get_title() { |
| 14 |
return __( 'Property Meta', 'propertyhive' ); |
| 15 |
} |
| 16 |
|
| 17 |
public function get_icon() { |
| 18 |
return 'eicon-bullet-list'; |
| 19 |
} |
| 20 |
|
| 21 |
public function get_categories() { |
| 22 |
return [ 'property-hive' ]; |
| 23 |
} |
| 24 |
|
| 25 |
public function get_keywords() { |
| 26 |
return [ 'property hive', 'propertyhive', 'property', 'meta' ]; |
| 27 |
} |
| 28 |
|
| 29 |
protected function register_controls() { |
| 30 |
|
| 31 |
$this->start_controls_section( |
| 32 |
'style_section', |
| 33 |
[ |
| 34 |
'label' => __( 'Property Meta', 'propertyhive' ), |
| 35 |
'tab' => \Elementor\Controls_Manager::TAB_STYLE, |
| 36 |
] |
| 37 |
); |
| 38 |
|
| 39 |
$this->add_group_control( |
| 40 |
\Elementor\Group_Control_Typography::get_type(), |
| 41 |
[ |
| 42 |
'name' => 'typography', |
| 43 |
'label' => __( 'Typography', 'propertyhive' ), |
| 44 |
'global' => [ |
| 45 |
'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY, |
| 46 |
], |
| 47 |
'selector' => '{{WRAPPER}} .property_meta li', |
| 48 |
] |
| 49 |
); |
| 50 |
|
| 51 |
$this->add_control( |
| 52 |
'list_color', |
| 53 |
[ |
| 54 |
'label' => __( 'Colour', 'propertyhive' ), |
| 55 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 56 |
'global' => [ |
| 57 |
'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, |
| 58 |
], |
| 59 |
'selectors' => [ |
| 60 |
'{{WRAPPER}} .property_meta li' => 'color: {{VALUE}}', |
| 61 |
], |
| 62 |
] |
| 63 |
); |
| 64 |
|
| 65 |
/*$this->add_control( |
| 66 |
'icon', |
| 67 |
[ |
| 68 |
'label' => __( 'List Icon', 'propertyhive' ), |
| 69 |
'type' => \Elementor\Controls_Manager::ICONS, |
| 70 |
'default' => [ |
| 71 |
'value' => 'fas fa-check', |
| 72 |
'library' => 'solid', |
| 73 |
], |
| 74 |
] |
| 75 |
);*/ |
| 76 |
|
| 77 |
$this->end_controls_section(); |
| 78 |
|
| 79 |
} |
| 80 |
|
| 81 |
protected function render() { |
| 82 |
|
| 83 |
global $property; |
| 84 |
|
| 85 |
$settings = $this->get_settings_for_display(); |
| 86 |
|
| 87 |
if ( !isset($property->id) ) { |
| 88 |
return; |
| 89 |
} |
| 90 |
|
| 91 |
propertyhive_template_single_meta(); |
| 92 |
|
| 93 |
} |
| 94 |
|
| 95 |
} |