| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) || exit; |
| 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' => __( 'Convert Gutenberg Blocks into shortcodes to use them anywhere.', 'ultimate-post' ), |
| 9 |
'img' => ULTP_URL.'/assets/img/addons/saved-template.svg', |
| 10 |
'is_pro' => false, |
| 11 |
'docs' => 'https://docs.wpxpo.com/docs/postx/add-on/shortcodes-support/', |
| 12 |
'live' => 'https://www.wpxpo.com/postx/addons/save-template/', |
| 13 |
); |
| 14 |
$arr['ultp_templates'] = $configuration; |
| 15 |
return $arr + $config; |
| 16 |
} |
| 17 |
|
| 18 |
add_action('init', 'ultp_templates_init'); |
| 19 |
function ultp_templates_init() { |
| 20 |
$settings = ultimate_post()->get_setting('ultp_templates'); |
| 21 |
if ($settings == 'true') { |
| 22 |
require_once ULTP_PATH.'/addons/templates/Saved_Templates.php'; |
| 23 |
require_once ULTP_PATH.'/addons/templates/Shortcode.php'; |
| 24 |
new \ULTP\Saved_Templates(); |
| 25 |
new \ULTP\Shortcode(); |
| 26 |
} |
| 27 |
} |