PluginProbe ʕ •ᴥ•ʔ
Essential Classy Addons for Elementor – 150+ Widgets, Templates & Performance Tools / 3.0.25
Essential Classy Addons for Elementor – 150+ Widgets, Templates & Performance Tools v3.0.25
3.0.59 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 3.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.18 3.0.2 3.0.20 3.0.21 3.0.22 3.0.23 3.0.24 3.0.25 3.0.26 3.0.27 3.0.28 3.0.29 3.0.3 3.0.30 3.0.31 3.0.32 3.0.33 3.0.34 3.0.35 3.0.36 3.0.37 3.0.38 3.0.39 3.0.4 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.0.46 3.0.47 3.0.48 3.0.49 3.0.5 3.0.50 3.0.51 3.0.52 3.0.53 3.0.54 3.0.55 3.0.56 3.0.57 3.0.58 3.0.6 3.0.7 3.0.8 3.0.9
essential-classy-addons-for-elementor / classes / builder-content.php
essential-classy-addons-for-elementor / classes Last commit date
builders 1 year ago documents 1 year ago builder-content.php 1 year ago class-helper.php 1 year ago class-loader.php 1 year ago class-panel-options.php 1 year ago conditions-file.php 1 year ago conditions-rules.php 1 year ago elementor-document.php 1 year ago theme-builder.php 1 year ago widgets-passing-lists.php 1 year ago
builder-content.php
83 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly.
4 }
5
6 class Ec_Template_Builder_Content {
7
8 public static $instance = null;
9
10 public static function get_instance() {
11 if ( ! isset( self::$instance ) ) {
12 self::$instance = new self;
13 }
14 return self::$instance;
15 }
16
17 public function ec_get_render_content( $template_ids = ''){
18 $content = '';
19 if( is_array($template_ids) ){
20 foreach( $template_ids as $post_id){
21 $content .= $this->ec_render_content($post_id);
22 }
23 }else{
24 $content .= $this->ec_render_content( $template_ids );
25 }
26
27 return $content;
28 }
29
30 public function ec_render_content( $post_id = ''){
31 global $wp_post_types;
32
33 //Elementor Builder
34 if ( class_exists( '\Elementor\Plugin' ) && $this->ec_is_elementor_build($post_id) ) {
35 $has_css = false;
36 if (('internal' === get_option('elementor_css_print_method')) || \Elementor\Plugin::$instance->preview->is_preview_mode()) {
37 $has_css = true;
38 }
39 $content = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $post_id, $has_css ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
40 if(empty($content)){
41 $content = \Elementor\Plugin::instance()->frontend->get_builder_content( $post_id );
42 }
43
44 return $content;
45 }
46
47 $has_rest_support = $wp_post_types[ ECAFE_POST ]->show_in_rest;
48
49 if ( $has_rest_support ) {
50 $output = '';
51 $curr_post = get_post( $post_id, OBJECT );
52
53 if ( has_blocks( $curr_post ) ) {
54 $blocks = parse_blocks( $curr_post->post_content );
55 foreach ( $blocks as $block ) {
56 $output .= render_block( $block );
57 }
58 } else if(isset($curr_post->post_content) && !empty($curr_post->post_content)) {
59 $output = $curr_post->post_content;
60 }
61
62 ob_start();
63 echo do_shortcode( $output );
64 return ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
65 }
66 }
67
68 /**
69 * Check Elementor Builder
70 */
71 public function ec_is_elementor_build( $post_id ) {
72 if(class_exists( '\Elementor\Plugin' ) ){
73 $document = \Elementor\Plugin::$instance->documents->get( $post_id );
74 if ( $document ) {
75 return $document->is_built_with_elementor();
76 } else {
77 return false;
78 }
79 }else{
80 return false;
81 }
82 }
83 }