# propertyhive/1.4.61/includes/elementor-widgets/property-availability.php

Property Hive, version 1.4.61. 85 lines.

- Page: https://pluginprobe.com/plugins/propertyhive/1.4.61/code/includes/elementor-widgets/property-availability.php
- Raw: https://pluginprobe.com/plugins/propertyhive/1.4.61/raw/includes/elementor-widgets/property-availability.php
- Modified: 2020-05-19T22:11:48+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/1.4.61/code/includes/elementor-widgets/property-availability.php#L10-L20`.

```php
<?php
/**
 * Elementor Property Availability Widget.
 *
 * @since 1.0.0
 */
class Elementor_Property_Availability_Widget extends \Elementor\Widget_Base {

	public function get_name() {
		return 'property-availability';
	}

	public function get_title() {
		return __( 'Availability', 'propertyhive' );
	}

	public function get_icon() {
		return 'fa fa-tag';
	}

	public function get_categories() {
		return [ 'property-hive' ];
	}

	public function get_keywords() {
		return [ 'property hive', 'propertyhive', 'property', 'availability', 'status' ];
	}

	protected function _register_controls() {

		$this->start_controls_section(
			'style_section',
			[
				'label' => __( 'Availability', 'propertyhive' ),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE,
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[
				'name' => 'typography',
				'label' => __( 'Typography', 'propertyhive' ),
				'scheme' => \Elementor\Scheme_Typography::TYPOGRAPHY_1,
				'selector' => '{{WRAPPER}} .elementor-widget-availability',
			]
		);

		$this->add_control(
			'color',
			[
				'label' => __( 'Colour', 'propertyhive' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'scheme' => [
					'type' => \Elementor\Scheme_Color::get_type(),
					'value' => \Elementor\Scheme_Color::COLOR_1,
				],
				'selectors' => [
					'{{WRAPPER}} .elementor-widget-availability' => 'color: {{VALUE}}',
				],
			]
		);

		$this->end_controls_section();

	}

	protected function render() {

		global $property;

		$settings = $this->get_settings_for_display();

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

		if ( $property->availability != '' )
		{
	        echo '<div class="elementor-widget-availability">' . $property->availability . '</div>';
	    }

	}

}
```
