PluginProbe
Property Hive / 2.2.4
Property Hive v2.2.4
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-address-county.php

property-address-county.php in Property Hive 2.2.4, at includes/elementor-widgets/property-address-county.php

118 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Elementor Property Address County Widget.
4 *
5 * @since 1.0.0
6 */
7 class Elementor_Property_Address_County_Widget extends \Elementor\Widget_Base {
8
9 public function get_name() {
10 return 'property-address-county';
11 }
12
13 public function get_title() {
14 return __( 'Address County', 'propertyhive' );
15 }
16
17 public function get_icon() {
18 return 'eicon-meta-data';
19 }
20
21 public function get_categories() {
22 return [ 'property-hive' ];
23 }
24
25 public function get_keywords() {
26 return [ 'property hive', 'propertyhive', 'property', 'address', 'county' ];
27 }
28
29 protected function register_controls() {
30
31
32 $this->start_controls_section(
33 'style_section',
34 [
35 'label' => __( 'Address County', 'propertyhive' ),
36 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
37 ]
38 );
39
40 $this->add_group_control(
41 \Elementor\Group_Control_Typography::get_type(),
42 [
43 'name' => 'typography',
44 'label' => __( 'Typography', 'propertyhive' ),
45 'global' => [
46 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY,
47 ],
48 'selector' => '{{WRAPPER}} .elementor-widget-address-county',
49 ]
50 );
51
52 $this->add_control(
53 'color',
54 [
55 'label' => __( 'Colour', 'propertyhive' ),
56 'type' => \Elementor\Controls_Manager::COLOR,
57 'global' => [
58 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY,
59 ],
60 'selectors' => [
61 '{{WRAPPER}} .elementor-widget-address-county' => 'color: {{VALUE}}',
62 ],
63 ]
64 );
65
66 $this->add_control(
67 'text_align',
68 [
69 'label' => __( 'Alignment', 'propertyhive' ),
70 'type' => \Elementor\Controls_Manager::CHOOSE,
71 'options' => [
72 'left' => [
73 'title' => __( 'Left', 'propertyhive' ),
74 'icon' => 'eicon-text-align-left',
75 ],
76 'center' => [
77 'title' => __( 'Center', 'propertyhive' ),
78 'icon' => 'eicon-text-align-center',
79 ],
80 'right' => [
81 'title' => __( 'Right', 'propertyhive' ),
82 'icon' => 'eicon-text-align-right',
83 ],
84 ],
85 'default' => 'left',
86 'toggle' => true,
87 'selectors' => [
88 '{{WRAPPER}} .elementor-widget-address-county' => 'text-align: {{VALUE}}',
89 ],
90 ]
91 );
92
93 $this->end_controls_section();
94
95 }
96
97 protected function render() {
98
99 global $property;
100
101 $settings = $this->get_settings_for_display();
102
103 if ( !isset($property->id) ) {
104 return;
105 }
106
107 if ( $property->address_four != '' )
108 {
109 echo '<div class="elementor-widget-address-county">';
110
111 echo esc_html($property->address_four);
112
113 echo '</div>';
114 }
115
116 }
117
118 }