| @@ -1,27 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | defined( 'ABSPATH' ) || exit; |
| 3 | 3 | |
| 4 | -add_filter('ultp_addons_config', 'ultp_templates_config'); | |
| 5 | -function ultp_templates_config( $config ) { | |
| 6 | - $configuration = array( | |
| 7 | - 'name' => __( 'Saved Templates', 'ultimate-post' ), | |
| 8 | - 'desc' => __( 'Create Short-codes and use them inside your page or page builder.', 'ultimate-post' ), | |
| 9 | - 'img' => ULTP_URL.'/assets/img/addons/saved-template.svg', | |
| 10 | - 'is_pro' => false | |
| 11 | - ); | |
| 12 | - $config['ultp_templates'] = $configuration; | |
| 13 | - return $config; | |
| 4 | +add_action( 'init', 'ultp_templates_init' ); | |
| 5 | +function ultp_templates_init() { | |
| 6 | + if ( ultimate_post()->get_setting( 'ultp_templates' ) == 'true' ) { | |
| 7 | + require_once ULTP_PATH . '/addons/templates/Saved_Templates.php'; | |
| 8 | + require_once ULTP_PATH . '/addons/templates/Shortcode.php'; | |
| 9 | + new \ULTP\Saved_Templates(); | |
| 10 | + new \ULTP\Shortcode(); | |
| 11 | + } | |
| 14 | 12 | } |
| 15 | - | |
| 16 | -add_action('init', 'ultp_templates_init'); | |
| 17 | -function ultp_templates_init(){ | |
| 18 | - $settings = ultimate_post()->get_setting(); | |
| 19 | - if ( isset($settings['ultp_templates']) ) { | |
| 20 | - if ($settings['ultp_templates'] == 'true') { | |
| 21 | - require_once ULTP_PATH.'/addons/templates/Saved_Templates.php'; | |
| 22 | - require_once ULTP_PATH.'/addons/templates/Shortcode.php'; | |
| 23 | - new \ULTP\Saved_Templates(); | |
| 24 | - new \ULTP\Shortcode(); | |
| 25 | - } | |
| 26 | - } | |
| 27 | -} | |