# propertyhive/2.2.3/includes/bricks-builder-widgets/property-address-postcode.php

Property Hive, version 2.2.3. 66 lines.

- Page: https://pluginprobe.com/plugins/propertyhive/2.2.3/code/includes/bricks-builder-widgets/property-address-postcode.php
- Raw: https://pluginprobe.com/plugins/propertyhive/2.2.3/raw/includes/bricks-builder-widgets/property-address-postcode.php
- Modified: 2025-05-13T08:38:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/propertyhive/2.2.3/code/includes/bricks-builder-widgets/property-address-postcode.php#L10-L20`.

```php
<?php
/**
 * Bricks Builder Property Address Postcode Widget.
 *
 * @since 1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

class Bricks_Builder_Property_Address_Postcode_Widget extends \Bricks\Element {

	// Element properties
	public $category     = 'propertyhive';
  	public $name         = 'bricks-builder-property-address-postcode';
  	public $icon         = 'fas fa-house';

	public function get_label() 
	{
	    return esc_html__( 'Address Postcode', 'propertyhive' );
	}

	public function set_control_groups() 
	{
		/*$this->control_groups['form'] = [
	      	'title' => esc_html__( 'Form', 'propertyhive' ),
	      	'tab' => 'content', // content / style
	    ];*/
	}

	public function set_controls() 
	{
		/*$this->controls['form_id'] = [ // Unique control identifier (lowercase, no spaces)
      		'tab' => 'content', // Control tab: content/style
      		//'group' => 'form', // Show under control group
      		'label' => esc_html__( 'Form ID', 'propertyhive' ), // Control label
      		'type' => 'text', // Control type 
      		'default' => esc_html__( 'default', 'bricks' ), // Default setting
    	];*/
	}

	public function render()
	{
		global $property;

		if ( !isset($property->id) ) 
		{
			return;
		}

		if ( $property->address_postcode == '' )
		{
			return;
		}

		$root_classes[] = $this->name;

	    // Add 'class' attribute to element root tag
	    $this->set_attribute( '_root', 'class', $root_classes );

		echo "<div {$this->render_attributes( '_root' )}>";

			echo esc_html($property->address_postcode);

		echo '</div>';
	}
}
```
