| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
class PH_Avada { |
| 8 |
|
| 9 |
private $widgets = array( |
| 10 |
'Property Actions', |
| 11 |
'Property Address Name Number', |
| 12 |
'Property Address Street', |
| 13 |
'Property Address Line 2', |
| 14 |
'Property Address Town City', |
| 15 |
'Property Address County', |
| 16 |
'Property Address Postcode', |
| 17 |
'Property Address Full', |
| 18 |
'Property Availability', |
| 19 |
'Property Bathrooms', |
| 20 |
'Property Bedrooms', |
| 21 |
'Property Brochures Link', |
| 22 |
'Property Council Tax Band', |
| 23 |
'Property Deposit', |
| 24 |
'Property Embedded Virtual Tours', |
| 25 |
'Property Enquiry Form', |
| 26 |
'Property Enquiry Form Link', |
| 27 |
'Property EPCs', |
| 28 |
'Property Features', |
| 29 |
'Property Floorplans', |
| 30 |
'Property Full Description', |
| 31 |
'Property Image', |
| 32 |
'Property Images', |
| 33 |
'Property Let Available Date', |
| 34 |
'Property Map', |
| 35 |
'Property Meta', |
| 36 |
'Property Price', |
| 37 |
'Property Reception Rooms', |
| 38 |
'Property Reference Number', |
| 39 |
'Property Street View', |
| 40 |
'Property Summary Description', |
| 41 |
'Property Tenure', |
| 42 |
'Property Type', |
| 43 |
); |
| 44 |
|
| 45 |
public function __construct() |
| 46 |
{ |
| 47 |
add_action('fusion_builder_before_init', array( $this, 'register_widgets' ) ); |
| 48 |
|
| 49 |
$widgets = apply_filters( 'propertyhive_avada_widgets', $this->widgets ); |
| 50 |
|
| 51 |
foreach ( $widgets as $widget ) |
| 52 |
{ |
| 53 |
$widget_dir = 'avada-widgets'; |
| 54 |
$widget_dir = apply_filters( 'propertyhive_avada_widget_directory', dirname(__FILE__) . "/" . $widget_dir, $widget ); |
| 55 |
if ( file_exists( $widget_dir . "/" . sanitize_title($widget) . "-shortcode.php" ) ) |
| 56 |
{ |
| 57 |
require_once( $widget_dir . "/" . sanitize_title($widget) . "-shortcode.php" ); |
| 58 |
} |
| 59 |
} |
| 60 |
} |
| 61 |
|
| 62 |
public function register_widgets() |
| 63 |
{ |
| 64 |
$widgets = apply_filters( 'propertyhive_avada_widgets', $this->widgets ); |
| 65 |
|
| 66 |
foreach ( $widgets as $widget ) |
| 67 |
{ |
| 68 |
$widget_dir = 'avada-widgets'; |
| 69 |
$widget_dir = apply_filters( 'propertyhive_avada_widget_directory', dirname(__FILE__) . "/" . $widget_dir, $widget ); |
| 70 |
if ( file_exists( $widget_dir . "/" . sanitize_title($widget) . ".php" ) ) |
| 71 |
{ |
| 72 |
require_once( $widget_dir . "/" . sanitize_title($widget) . ".php" ); |
| 73 |
} |
| 74 |
} |
| 75 |
|
| 76 |
} |
| 77 |
} |
| 78 |
|
| 79 |
new PH_Avada(); |