PluginProbe
Property Hive / 1.4.60
Property Hive v1.4.60
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
propertyhive / includes / elementor-widgets / property-bathrooms.php

property-bathrooms.php in Property Hive 1.4.60, at includes/elementor-widgets/property-bathrooms.php

139 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Elementor Property Bathrooms Widget.
4 *
5 * @since 1.0.0
6 */
7 class Elementor_Property_Bathrooms_Widget extends \Elementor\Widget_Base {
8
9 public function get_name() {
10 return 'property-bathrooms';
11 }
12
13 public function get_title() {
14 return __( 'Bathrooms', 'propertyhive' );
15 }
16
17 public function get_icon() {
18 return 'fa fa-bath';
19 }
20
21 public function get_categories() {
22 return [ 'property-hive' ];
23 }
24
25 public function get_keywords() {
26 return [ 'property hive', 'propertyhive', 'property', 'bathroom', 'room' ];
27 }
28
29 protected function _register_controls() {
30
31 $this->start_controls_section(
32 'content_section',
33 [
34 'label' => __( 'Bathrooms', 'propertyhive' ),
35 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
36 ]
37 );
38
39 $this->add_control(
40 'icon',
41 [
42 'label' => __( 'Icon', 'propertyhive' ),
43 'type' => \Elementor\Controls_Manager::ICONS,
44 'default' => [
45 'value' => 'fas fa-bath',
46 'library' => 'solid',
47 ],
48 ]
49 );
50
51 $this->add_control(
52 'before',
53 [
54 'label' => __( 'Before', 'propertyhive' ),
55 'type' => \Elementor\Controls_Manager::TEXT,
56 ]
57 );
58
59 $this->add_control(
60 'after',
61 [
62 'label' => __( 'After', 'propertyhive' ),
63 'type' => \Elementor\Controls_Manager::TEXT,
64 'default' => __( 'Bathrooms', 'propertyhive' ),
65 ]
66 );
67
68 $this->end_controls_section();
69
70 $this->start_controls_section(
71 'style_section',
72 [
73 'label' => __( 'Bathrooms', 'propertyhive' ),
74 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
75 ]
76 );
77
78 $this->add_group_control(
79 \Elementor\Group_Control_Typography::get_type(),
80 [
81 'name' => 'typography',
82 'label' => __( 'Typography', 'propertyhive' ),
83 'scheme' => \Elementor\Scheme_Typography::TYPOGRAPHY_1,
84 'selector' => '{{WRAPPER}} .elementor-widget-bathrooms',
85 ]
86 );
87
88 $this->add_control(
89 'color',
90 [
91 'label' => __( 'Colour', 'propertyhive' ),
92 'type' => \Elementor\Controls_Manager::COLOR,
93 'scheme' => [
94 'type' => \Elementor\Scheme_Color::get_type(),
95 'value' => \Elementor\Scheme_Color::COLOR_1,
96 ],
97 'selectors' => [
98 '{{WRAPPER}} .elementor-widget-bathrooms' => 'color: {{VALUE}}',
99 ],
100 ]
101 );
102
103 $this->end_controls_section();
104
105 }
106
107 protected function render() {
108
109 global $property;
110
111 $settings = $this->get_settings_for_display();
112
113 if ( !isset($property->id) ) {
114 return;
115 }
116
117 if ( $property->bathrooms != '' && $property->bathrooms != 0 )
118 {
119 echo '<div class="elementor-widget-bathrooms">';
120 if ( isset($settings['icon']) && !empty($settings['icon']) )
121 {
122 \Elementor\Icons_Manager::render_icon( $settings['icon'], [ 'aria-hidden' => 'true' ] );
123 echo ' ';
124 }
125 if ( isset($settings['before']) && !empty($settings['before']) )
126 {
127 echo $settings['before'] . ' ';
128 }
129 echo $property->bathrooms;
130 if ( isset($settings['after']) && !empty($settings['after']) )
131 {
132 echo ' ' . $settings['after'];
133 }
134 echo '</div>';
135 }
136
137 }
138
139 }