| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPAdminify\Inc\Modules\AdminPages; |
| 4 |
|
| 5 |
// no direct access allowed |
| 6 |
if (!defined('ABSPATH')) exit; |
| 7 |
|
| 8 |
/** |
| 9 |
* WPAdminify |
| 10 |
* @package Admin Pages |
| 11 |
* |
| 12 |
* @author Jewel Theme <support@jeweltheme.com> |
| 13 |
*/ |
| 14 |
|
| 15 |
|
| 16 |
class AdminPages_Render extends AdminPagesModel |
| 17 |
{ |
| 18 |
public function __construct($post, $from_multisite = false) |
| 19 |
{ |
| 20 |
$this->init_admin_page_content($post, $from_multisite = false); |
| 21 |
} |
| 22 |
|
| 23 |
public function init_admin_page_content($post, $from_multisite = false) |
| 24 |
{ |
| 25 |
$remove_page_title = $post->remove_page_title; |
| 26 |
$remove_page_margin = $post->remove_page_margin; |
| 27 |
|
| 28 |
$custom_css = $post->custom_css; |
| 29 |
?> |
| 30 |
<style> |
| 31 |
<?php if ($remove_page_margin) { ?>#wpcontent { |
| 32 |
padding-left: 0; |
| 33 |
} |
| 34 |
|
| 35 |
.wrap { |
| 36 |
margin: 0; |
| 37 |
} |
| 38 |
|
| 39 |
<?php } |
| 40 |
|
| 41 |
if ($custom_css) { |
| 42 |
echo wp_strip_all_tags($custom_css); |
| 43 |
} |
| 44 |
?> |
| 45 |
</style> |
| 46 |
|
| 47 |
<div class="wrap"> |
| 48 |
<?php if (!$remove_page_title) : ?> |
| 49 |
<h1><?php echo esc_html($post->post_title); ?></h1> |
| 50 |
<?php else : ?> |
| 51 |
<h1 style="display: none;"></h1> |
| 52 |
<?php endif; ?> |
| 53 |
|
| 54 |
<?php |
| 55 |
if (jltwp_adminify()->can_use_premium_code__premium_only()) { |
| 56 |
if ('html' === $post->content_type) { |
| 57 |
echo $post->html_content; |
| 58 |
} else { |
| 59 |
echo apply_filters('the_content', $post->post_content); |
| 60 |
} |
| 61 |
} |
| 62 |
?> |
| 63 |
</div> |
| 64 |
|
| 65 |
<?php } |
| 66 |
} |
| 67 |
|