PluginProbe
Property Hive / 2.2.6
Property Hive v2.2.6
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-full.php

property-address-full.php in Property Hive 2.2.6, at includes/elementor-widgets/property-address-full.php

123 lines 2.8 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 Full Widget.
4 *
5 * @since 1.0.0
6 */
7 class Elementor_Property_Address_Full_Widget extends \Elementor\Widget_Base {
8
9 public function get_name() {
10 return 'property-address-full';
11 }
12
13 public function get_title() {
14 return __( 'Full Address', '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' ];
27 }
28
29 protected function register_controls() {
30
31
32 $this->start_controls_section(
33 'style_section',
34 [
35 'label' => __( 'Full Address', 'propertyhive' ),
36 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
37 ]
38 );
39
40 $this->add_control(
41 'note',
42 [
43 'label' => __( 'Note', 'propertyhive' ),
44 'type' => \Elementor\Controls_Manager::RAW_HTML,
45 'raw' => __( 'This widget will output the full address, including name/number and postcode. Use the \'Post Title\' widget to display the public display address', 'propertyhive' ),
46 ]
47 );
48
49 $this->add_group_control(
50 \Elementor\Group_Control_Typography::get_type(),
51 [
52 'name' => 'typography',
53 'label' => __( 'Typography', 'propertyhive' ),
54 'global' => [
55 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY,
56 ],
57 'selector' => '{{WRAPPER}} .elementor-widget-address-full',
58 ]
59 );
60
61 $this->add_control(
62 'color',
63 [
64 'label' => __( 'Colour', 'propertyhive' ),
65 'type' => \Elementor\Controls_Manager::COLOR,
66 'global' => [
67 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY,
68 ],
69 'selectors' => [
70 '{{WRAPPER}} .elementor-widget-address-full' => 'color: {{VALUE}}',
71 ],
72 ]
73 );
74
75 $this->add_control(
76 'text_align',
77 [
78 'label' => __( 'Alignment', 'propertyhive' ),
79 'type' => \Elementor\Controls_Manager::CHOOSE,
80 'options' => [
81 'left' => [
82 'title' => __( 'Left', 'propertyhive' ),
83 'icon' => 'eicon-text-align-left',
84 ],
85 'center' => [
86 'title' => __( 'Center', 'propertyhive' ),
87 'icon' => 'eicon-text-align-center',
88 ],
89 'right' => [
90 'title' => __( 'Right', 'propertyhive' ),
91 'icon' => 'eicon-text-align-right',
92 ],
93 ],
94 'default' => 'left',
95 'toggle' => true,
96 'selectors' => [
97 '{{WRAPPER}} .elementor-widget-address-full' => 'text-align: {{VALUE}}',
98 ],
99 ]
100 );
101
102 $this->end_controls_section();
103
104 }
105
106 protected function render() {
107
108 global $property;
109
110 $settings = $this->get_settings_for_display();
111
112 if ( !isset($property->id) ) {
113 return;
114 }
115
116 echo '<div class="elementor-widget-address-full">';
117
118 echo esc_html($property->get_formatted_full_address());
119
120 echo '</div>';
121 }
122
123 }