PluginProbe
Property Hive / 2.3.0
Property Hive v2.3.0
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 / divi-widgets / property-address-postcode.php

property-address-postcode.php in Property Hive 2.3.0, at includes/divi-widgets/property-address-postcode.php

48 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5
6 class Divi_Property_Address_Postcode_Widget extends ET_Builder_Module
7 {
8 public $slug = 'et_pb_property_address_postcode_widget';
9 public $vb_support = 'partial';
10 public $icon = '';
11
12 public function init() {
13 $this->name = esc_html__( 'Property Address Postcode', 'propertyhive' );
14 $this->icon = '3';
15 $this->main_css_element = '%%order_class%%';
16 }
17
18 public function get_fields()
19 {
20 $fields = array();
21
22 return $fields;
23 }
24
25 public function render( $attrs, $content, $render_slug )
26 {
27 $post_id = get_the_ID();
28
29 $property = new PH_Property($post_id);
30
31 if ( !isset($property->id) ) {
32 return;
33 }
34
35 if ( $property->address_postcode == '' )
36 {
37 return;
38 }
39
40 $return = '<div class="divi-widget-address-postcode">';
41
42 $return .= esc_html($property->address_postcode);
43
44 $return .= '</div>';
45
46 return $this->_render_module_wrapper( $return, $render_slug );
47 }
48 }