| @@ -1,12 +1,25 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | defined( 'ABSPATH' ) || exit; |
| 3 | 3 | |
| 4 | -add_action( 'plugins_loaded', 'ultp_elementor_init' ); | |
| 5 | -function ultp_elementor_init() { | |
| 6 | - if ( ultimate_post()->get_setting( 'ultp_elementor' ) == 'true' ) { | |
| 7 | - if ( did_action( 'elementor/loaded' ) ) { | |
| 8 | - require_once ULTP_PATH . '/addons/elementor/Elementor.php'; | |
| 4 | +add_filter('ultp_addons_config', 'ultp_elementor_config'); | |
| 5 | +function ultp_elementor_config( $config ) { | |
| 6 | + $configuration = array( | |
| 7 | + 'name' => __( 'Elementor Addons', 'ultimate-post' ), | |
| 8 | + 'desc' => __( 'Enable Elementor Addons for Elementor Website Builder.', 'ultimate-post' ), | |
| 9 | + 'img' => ULTP_URL.'/assets/img/addons/saved-template.svg', | |
| 10 | + 'is_pro' => false | |
| 11 | + ); | |
| 12 | + $config['ultp_elementor'] = $configuration; | |
| 13 | + return $config; | |
| 14 | +} | |
| 15 | + | |
| 16 | +add_action('plugins_loaded', 'ultp_elementor_init'); | |
| 17 | +function ultp_elementor_init(){ | |
| 18 | + $settings = ultimate_post()->get_setting('ultp_elementor'); | |
| 19 | + if ($settings == 'true') { | |
| 20 | + if(did_action( 'elementor/loaded' )){ | |
| 21 | + require_once ULTP_PATH.'/addons/elementor/Elementor.php'; | |
| 9 | 22 | Elementor_ULTP_Extension::instance(); |
| 10 | 23 | } |
| 11 | 24 | } |
| 12 | -} | |
| 25 | +} | |