| 1 |
<?php |
| 2 |
/** |
| 3 |
* Bricks Builder Property Features Widget. |
| 4 |
* |
| 5 |
* @since 1.0.0 |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 9 |
|
| 10 |
class Bricks_Builder_Property_Features_Widget extends \Bricks\Element { |
| 11 |
|
| 12 |
// Element properties |
| 13 |
public $category = 'propertyhive'; |
| 14 |
public $name = 'bricks-builder-property-features'; |
| 15 |
public $icon = 'fas fa-sterling-sign'; |
| 16 |
|
| 17 |
public function get_label() |
| 18 |
{ |
| 19 |
return esc_html__( 'Features', 'propertyhive' ); |
| 20 |
} |
| 21 |
|
| 22 |
public function set_control_groups() |
| 23 |
{ |
| 24 |
/*$this->control_groups['form'] = [ |
| 25 |
'title' => esc_html__( 'Form', 'propertyhive' ), |
| 26 |
'tab' => 'content', // content / style |
| 27 |
];*/ |
| 28 |
} |
| 29 |
|
| 30 |
public function set_controls() |
| 31 |
{ |
| 32 |
/*$this->controls['form_id'] = [ // Unique control identifier (lowercase, no spaces) |
| 33 |
'tab' => 'content', // Control tab: content/style |
| 34 |
//'group' => 'form', // Show under control group |
| 35 |
'label' => esc_html__( 'Form ID', 'propertyhive' ), // Control label |
| 36 |
'type' => 'text', // Control type |
| 37 |
'default' => esc_html__( 'default', 'bricks' ), // Default setting |
| 38 |
];*/ |
| 39 |
} |
| 40 |
|
| 41 |
public function render() |
| 42 |
{ |
| 43 |
global $property; |
| 44 |
|
| 45 |
if ( !isset($property->id) ) |
| 46 |
{ |
| 47 |
return; |
| 48 |
} |
| 49 |
|
| 50 |
$root_classes[] = $this->name; |
| 51 |
|
| 52 |
// Add 'class' attribute to element root tag |
| 53 |
$this->set_attribute( '_root', 'class', $root_classes ); |
| 54 |
|
| 55 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Bricks serializes registered attributes through its documented render_attributes() API. |
| 56 |
echo "<div {$this->render_attributes( '_root' )}>"; |
| 57 |
|
| 58 |
propertyhive_template_single_features(); |
| 59 |
|
| 60 |
echo '</div>'; |
| 61 |
} |
| 62 |
} |
| 63 |
|