PluginProbe
Property Hive / 2.3.0
Property Hive v2.3.0
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 1.4.62 All 260 releases
propertyhive / includes / elementor-widgets / property-address-postcode.php

property-address-postcode.php in Property Hive 2.3.0, at includes/elementor-widgets/property-address-postcode.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 Postcode Widget.
4 *
5 * @since 1.0.0
6 */
7 class Elementor_Property_Address_Postcode_Widget extends \Elementor\Widget_Base {
8
9 public function get_name() {
10 return 'property-address-postcode';
11 }
12
13 public function get_title() {
14 return __( 'Address Postcode', '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', 'postcode' ];
27 }
28
29 protected function register_controls() {
30
31
32 $this->start_controls_section(
33 'style_section',
34 [
35 'label' => __( 'Address Postcode', '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-postcode',
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-postcode' => '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-postcode' => '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_postcode != '' )
108 {
109 echo '<div class="elementor-widget-address-postcode">';
110
111 echo esc_html($property->address_postcode);
112
113 echo '</div>';
114 }
115
116 }
117
118 }