# propertyhive/2.2.2/includes/bricks-builder-widgets/property-actions.php

Property Hive, version 2.2.2. 76 lines.

- Page: https://pluginprobe.com/plugins/propertyhive/2.2.2/code/includes/bricks-builder-widgets/property-actions.php
- Raw: https://pluginprobe.com/plugins/propertyhive/2.2.2/raw/includes/bricks-builder-widgets/property-actions.php
- Modified: 2023-11-30T13:34:36+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.2/code/includes/bricks-builder-widgets/property-actions.php#L10-L20`.

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

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

class Bricks_Builder_Property_Actions_Widget extends \Bricks\Element {

	// Element properties
	public $category     = 'propertyhive';
  	public $name         = 'bricks-builder-property-actions';
  	public $icon         = 'fas fa-bars';

	public function get_label() 
	{
	    return esc_html__( 'Actions', '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['display'] = [
	      	'tab' => 'content',
	      	//'group' => 'settings',
	      	'label' => esc_html__( 'Display As', 'propertyhive' ),
	      	'type' => 'select',
	      	'options' => [
	        	'list' => __( 'List', 'propertyhive' ),
				'buttons' => __( 'Buttons', 'propertyhive' ),
	      	],
	      	//'inline' => true,
	      	//'clearable' => false,
	      	//'pasteStyles' => false,
	      	'default' => 'list',
	    ];

	    $this->controls['button_background_color'] = [
	      	'tab' => 'content',
	      	//'group' => 'settings',
	      	'label' => esc_html__( 'Button Background Colour', 'propertyhive' ),
	      	'type' => 'color',
	      	'required' => ['layout', '=', ['buttons']],
	    ];
	}

	public function render()
	{
		global $property;

		if ( !isset($property->id) ) 
		{
			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' )}>";

			propertyhive_template_single_actions();

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