Example #1
0
 public function on_delete_post($post_id)
 {
     $css_file = new Post_CSS_File($post_id);
     $css_file->delete();
 }
Example #2
0
    public function get_builder_content($post_id, $with_css = false)
    {
        if (post_password_required($post_id)) {
            return '';
        }
        $data = Plugin::instance()->db->get_plain_editor($post_id);
        $edit_mode = Plugin::instance()->db->get_edit_mode($post_id);
        if (empty($data) || 'builder' !== $edit_mode) {
            return '';
        }
        $css_file = new Post_CSS_File($post_id);
        $css_file->enqueue();
        ob_start();
        // Handle JS and Customizer requests, with css inline
        if (is_customize_preview() || Utils::is_ajax()) {
            $with_css = true;
        }
        if ($with_css) {
            echo '<style>' . $css_file->get_css() . '</style>';
        }
        ?>
		<div id="elementor" class="elementor elementor-<?php 
        echo $post_id;
        ?>
">
			<div id="elementor-inner">
				<div id="elementor-section-wrap">
					<?php 
        $this->_print_sections($data);
        ?>
				</div>
			</div>
		</div>
		<?php 
        return apply_filters('elementor/frontend/the_content', ob_get_clean());
    }