| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
class PH_Bricks_Builder { |
| 8 |
|
| 9 |
public function __construct() |
| 10 |
{ |
| 11 |
add_action( 'init', array( $this, 'register_widgets' ), 11 ); |
| 12 |
} |
| 13 |
|
| 14 |
public function register_widgets() |
| 15 |
{ |
| 16 |
if ( !defined('BRICKS_DB_TEMPLATE_SLUG') ) |
| 17 |
{ |
| 18 |
return; |
| 19 |
} |
| 20 |
|
| 21 |
$widgets = array( |
| 22 |
'Property Search Form', |
| 23 |
'Property Images', |
| 24 |
'Property Image', |
| 25 |
'Property Gallery', |
| 26 |
'Property Address Name Number', |
| 27 |
'Property Address Street', |
| 28 |
'Property Address Line 2', |
| 29 |
'Property Address Town City', |
| 30 |
'Property Address County', |
| 31 |
'Property Address Postcode', |
| 32 |
'Property Price', |
| 33 |
'Property Price Qualifier', |
| 34 |
'Property Features', |
| 35 |
'Property Summary Description', |
| 36 |
'Property Full Description', |
| 37 |
'Property Actions', |
| 38 |
'Property Meta', |
| 39 |
'Property Availability', |
| 40 |
'Property Type', |
| 41 |
'Property Bedrooms', |
| 42 |
'Property Bathrooms', |
| 43 |
'Property Reception Rooms', |
| 44 |
'Property Reference Number', |
| 45 |
'Property Floor Area', |
| 46 |
'Property Tenure', |
| 47 |
'Property Council Tax Band', |
| 48 |
'Property Let Available Date', |
| 49 |
'Property Deposit', |
| 50 |
'Property Map', |
| 51 |
'Property Map Link', |
| 52 |
'Property Street View', |
| 53 |
'Property Floorplans', |
| 54 |
'Property Floorplans Link', |
| 55 |
'Property EPCs', |
| 56 |
'Property EPCs Link', |
| 57 |
'Property Enquiry Form', |
| 58 |
'Property Enquiry Form Link', |
| 59 |
'Property Brochures Link', |
| 60 |
'Property Embedded Virtual Tours', |
| 61 |
'Property Virtual Tours Link', |
| 62 |
/*'Property Office Name', |
| 63 |
'Property Office Telephone Number', |
| 64 |
'Property Office Email Address', |
| 65 |
'Property Office Address', |
| 66 |
'Property Negotiator Name', |
| 67 |
'Property Negotiator Telephone Number', |
| 68 |
'Property Negotiator Email Address', |
| 69 |
'Property Negotiator Photo', |
| 70 |
'Back To Search', |
| 71 |
'Property Search Result Count', |
| 72 |
'Property Search Order',*/ |
| 73 |
); |
| 74 |
|
| 75 |
$widgets = apply_filters( 'propertyhive_bricks_builder_widgets', $widgets ); |
| 76 |
|
| 77 |
foreach ( $widgets as $widget ) |
| 78 |
{ |
| 79 |
$widget_dir = 'bricks-builder-widgets'; |
| 80 |
$widget_dir = apply_filters( 'propertyhive_bricks_builder_widget_directory', dirname(__FILE__) . "/" . $widget_dir, $widget ); |
| 81 |
if ( file_exists( $widget_dir . "/" . sanitize_title($widget) . ".php" ) ) |
| 82 |
{ |
| 83 |
\Bricks\Elements::register_element( $widget_dir . "/" . sanitize_title($widget) . ".php" ); |
| 84 |
} |
| 85 |
} |
| 86 |
} |
| 87 |
} |
| 88 |
|
| 89 |
new PH_Bricks_Builder(); |