PluginProbe ʕ •ᴥ•ʔ
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More / 3.5.0
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More v3.5.0
4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 trunk 1.0.0 2.0.0 2.0.1 2.0.2 2.0.3 3.0 3.0.1 3.0.2 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.2.0 3.2.1 3.2.2 3.2.4 3.2.5 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.4.5 3.4.6 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1
superb-blocks / src / library / controllers / class-library-controller.php
superb-blocks / src / library / controllers Last commit date
class-library-controller.php 1 year ago class-request-controller.php 1 year ago
class-library-controller.php
46 lines
1 <?php
2
3 namespace SuperbAddons\Library\Controllers;
4
5 use SuperbAddons\Data\Utils\AllowedTemplateHTMLUtil;
6
7 defined('ABSPATH') || exit();
8
9
10 class LibraryController
11 {
12 public static function InsertTemplates()
13 {
14 self::OutputTemplates(false);
15 }
16
17 public static function InsertTemplatesWithWrapper()
18 {
19 self::OutputTemplates();
20 }
21
22 private static function OutputTemplates($with_wrapper = true)
23 {
24 AllowedTemplateHTMLUtil::enable_safe_styles();
25 ob_start();
26 if ($with_wrapper) {
27 echo '<div class="superb-addons-template-library-page-wrapper" style="display:none;">';
28 }
29 include(SUPERBADDONS_PLUGIN_DIR . 'src/library/templates/library-page.php');
30 if ($with_wrapper) {
31 echo '</div>';
32 }
33 $template = ob_get_clean();
34 echo '<script type="text/template" id="tmpl-superbaddons-superb-library-page">' . wp_kses($template, "post") . '</script>';
35 ob_start();
36 include(SUPERBADDONS_PLUGIN_DIR . 'src/library/templates/library-item.php');
37 $template = ob_get_clean();
38 echo '<script type="text/template" id="tmpl-superbaddons-superb-library-item">' . wp_kses($template, "post") . '</script>';
39 ob_start();
40 include(SUPERBADDONS_PLUGIN_DIR . 'src/library/templates/library-menu-item.php');
41 $template = ob_get_clean();
42 echo '<script type="text/template" id="tmpl-superbaddons-superb-library-menu-item">' . wp_kses($template, "post") . '</script>';
43 AllowedTemplateHTMLUtil::disable_safe_styles();
44 }
45 }
46