| 1 |
<?php |
| 2 |
/** |
| 3 |
* Master Addons Canvas Template |
| 4 |
*/ |
| 5 |
|
| 6 |
use MasterAddons\Inc\Admin\Theme_Builder\Theme_Builder; |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
// Get the template ID that was stored in wp_query |
| 13 |
global $wp_query; |
| 14 |
$template_id = $wp_query->get( 'master_template_id' ); |
| 15 |
|
| 16 |
?><!DOCTYPE html> |
| 17 |
<html <?php language_attributes(); ?>> |
| 18 |
<head> |
| 19 |
<meta charset="<?php bloginfo( 'charset' ); ?>"> |
| 20 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> |
| 21 |
<?php if ( ! current_theme_supports( 'title-tag' ) ) : ?> |
| 22 |
<title> |
| 23 |
<?php echo esc_html(wp_get_document_title()); ?> |
| 24 |
</title> |
| 25 |
<?php endif; ?> |
| 26 |
<?php wp_head(); ?> |
| 27 |
</head> |
| 28 |
|
| 29 |
<body <?php body_class(); ?>> |
| 30 |
|
| 31 |
<?php |
| 32 |
do_action( 'wp_body_open' ); |
| 33 |
|
| 34 |
// Render Master Addons template content |
| 35 |
if ( $template_id && class_exists( 'MasterAddons\Inc\Admin\Theme_Builder\Theme_Builder' ) ) { |
| 36 |
echo Theme_Builder::render_elementor_content( $template_id ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- render_elementor_content() returns sanitized Elementor/wp_kses_post markup |
| 37 |
} else { |
| 38 |
echo '<p>Master Addons template system not available.</p>'; |
| 39 |
} |
| 40 |
|
| 41 |
wp_footer(); |
| 42 |
?> |
| 43 |
|
| 44 |
</body> |
| 45 |
</html> |