| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) || exit; |
| 3 |
|
| 4 |
add_filter('ultp_addons_config', 'ultp_new_builder_config'); |
| 5 |
function ultp_new_builder_config( $config ) { |
| 6 |
$configuration = array( |
| 7 |
'name' => __( 'Dynamic Site Builder', 'ultimate-post-pro' ), |
| 8 |
'desc' => __( 'Create dynamic websites using the PostX instead of old-school page builders.', 'ultimate-post-pro' ), |
| 9 |
'img' => ULTP_URL.'assets/img/addons/builder-icon.svg', |
| 10 |
'docs' => 'https://docs.wpxpo.com/docs/postx/add-on/archive-builder/', |
| 11 |
'live' => 'https://www.wpxpo.com/postx/addons/builder/', |
| 12 |
'is_pro' => false |
| 13 |
); |
| 14 |
$config['ultp_builder'] = $configuration; |
| 15 |
return $config; |
| 16 |
} |
| 17 |
|
| 18 |
add_action('init', 'ultp_new_builder_init'); |
| 19 |
function ultp_new_builder_init(){ |
| 20 |
$settings = isset($GLOBALS['ultp_settings']) ? $GLOBALS['ultp_settings'] : []; |
| 21 |
if ( isset($settings['ultp_builder']) ) { |
| 22 |
if ($settings['ultp_builder'] == 'true') { |
| 23 |
require_once ULTP_PATH.'/addons/builder/Builder.php'; |
| 24 |
require_once ULTP_PATH.'/addons/builder/RequestAPI.php'; |
| 25 |
new \ULTP\Builder(); |
| 26 |
new \ULTP\RequestAPI(); |
| 27 |
} |
| 28 |
} |
| 29 |
} |