| 1 |
<?php |
| 2 |
|
| 3 |
namespace Templately\Builder\Types; |
| 4 |
|
| 5 |
use Elementor\Plugin; |
| 6 |
|
| 7 |
abstract class ThemeTemplate extends BaseTemplate { |
| 8 |
|
| 9 |
public function get_location() { |
| 10 |
return $this->get_property( 'location' ); |
| 11 |
} |
| 12 |
|
| 13 |
public function print_content() { |
| 14 |
if ( $this->is_elementor_template() && class_exists( 'Elementor\Plugin' ) ) { |
| 15 |
$plugin = Plugin::$instance; |
| 16 |
|
| 17 |
if ( $plugin->preview->is_preview_mode( $this->get_main_id() ) ) { |
| 18 |
// PHPCS - the method builder_wrapper is safe. |
| 19 |
echo $plugin->preview->builder_wrapper( '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 20 |
} else { |
| 21 |
// PHPCS - the method get_content is safe. |
| 22 |
echo $this->get_content(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 23 |
} |
| 24 |
|
| 25 |
|
| 26 |
return; |
| 27 |
} |
| 28 |
$content = $this->get_content(); |
| 29 |
echo do_blocks( $content ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 30 |
|
| 31 |
if(function_exists('wp_script_modules')){ |
| 32 |
add_action( 'wp_footer', array( wp_script_modules(), 'print_import_map' ) ); |
| 33 |
add_action( 'wp_footer', array( wp_script_modules(), 'print_enqueued_script_modules' ) ); |
| 34 |
add_action( 'wp_footer', array( wp_script_modules(), 'print_script_module_preloads' ) ); |
| 35 |
} |
| 36 |
} |
| 37 |
} |