| @@ -2,14 +2,14 @@ | ||
| 2 | 2 | defined( 'ABSPATH' ) || exit; |
| 3 | 3 | |
| 4 | 4 | global $ULTP_HEADER_ID; |
| 5 | 5 | global $ULTP_FOOTER_ID; |
| 6 | -$header = ''; | |
| 6 | +$ultp_header = ''; | |
| 7 | 7 | |
| 8 | 8 | if ( wp_is_block_theme() && ! $ULTP_HEADER_ID ) { |
| 9 | 9 | ob_start(); |
| 10 | 10 | block_template_part( 'header' ); |
| 11 | - $header = ob_get_clean(); | |
| 11 | + $ultp_header = ob_get_clean(); | |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | if ( wp_is_block_theme() ) { |
| 15 | 15 | ?><!DOCTYPE html> |
| @@ -21,10 +21,10 @@ | ||
| 21 | 21 | <body <?php body_class(); ?>> |
| 22 | 22 | <?php |
| 23 | 23 | wp_body_open(); |
| 24 | 24 | |
| 25 | - if ( $header ) { | |
| 26 | - echo '<header class="wp-block-template-part">' . $header . '</header>'; | |
| 25 | + if ( $ultp_header ) { | |
| 26 | + echo '<header class="wp-block-template-part">' . $ultp_header . '</header>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Core-rendered block template part. | |
| 27 | 27 | } |
| 28 | 28 | } else { |
| 29 | 29 | get_header(); |
| 30 | 30 | } |
| @@ -32,48 +32,48 @@ | ||
| 32 | 32 | do_action( 'ultp_before_content' ); |
| 33 | 33 | |
| 34 | 34 | global $ultp_page_builder_id; |
| 35 | 35 | if ( $ultp_page_builder_id ) { |
| 36 | - $page_id = $ultp_page_builder_id; | |
| 36 | + $ultp_page_id = $ultp_page_builder_id; | |
| 37 | 37 | } else { |
| 38 | - $page_id = ultimate_post()->builder_check_conditions( 'return_p' ); | |
| 38 | + $ultp_page_id = ultimate_post()->builder_check_conditions( 'return_p' ); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | -$width = $page_id ? ( get_post_meta( $page_id, '__container_width', true ) ? get_post_meta( $page_id, '__container_width', true ) : '1140' ) : '1140'; | |
| 42 | -$sidebar = $page_id ? get_post_meta( $page_id, '__builder_sidebar', true ) : ''; | |
| 43 | -$widget_area = $page_id ? get_post_meta( $page_id, '__builder_widget_area', true ) : ''; | |
| 44 | -$has_widget = ( $sidebar && $widget_area != '' ) ? true : false; | |
| 41 | +$ultp_width = $ultp_page_id ? ( get_post_meta( $ultp_page_id, '__container_width', true ) ? get_post_meta( $ultp_page_id, '__container_width', true ) : '1140' ) : '1140'; | |
| 42 | +$ultp_sidebar = $ultp_page_id ? get_post_meta( $ultp_page_id, '__builder_sidebar', true ) : ''; | |
| 43 | +$ultp_widget_area = $ultp_page_id ? get_post_meta( $ultp_page_id, '__builder_widget_area', true ) : ''; | |
| 44 | +$ultp_has_widget = ( $ultp_sidebar && $ultp_widget_area != '' ) ? true : false; | |
| 45 | 45 | |
| 46 | -echo '<div class="ultp-builder-container' . ( esc_html( $has_widget ? ' ultp-widget-' . $sidebar : '' ) ) . ( esc_html( ' ultp-builderid-' . $page_id ) ) . '" style="margin:0 auto; width: -webkit-fill-available; width: -moz-available; max-width: ' . esc_html( $width ) . 'px;">'; | |
| 47 | -if ( $has_widget && $sidebar == 'left' ) { | |
| 46 | +echo '<div class="ultp-builder-container' . ( esc_attr( $ultp_has_widget ? ' ultp-widget-' . $ultp_sidebar : '' ) ) . ( esc_attr( ' ultp-builderid-' . $ultp_page_id ) ) . '" style="margin:0 auto; width: -webkit-fill-available; width: -moz-available; max-width: ' . esc_attr( $ultp_width ) . 'px;">'; | |
| 47 | +if ( $ultp_has_widget && $ultp_sidebar == 'left' ) { | |
| 48 | 48 | echo '<div class="ultp-sidebar-left">'; |
| 49 | - if ( is_active_sidebar( $widget_area ) ) { | |
| 50 | - dynamic_sidebar( $widget_area ); | |
| 49 | + if ( is_active_sidebar( $ultp_widget_area ) ) { | |
| 50 | + dynamic_sidebar( $ultp_widget_area ); | |
| 51 | 51 | } |
| 52 | 52 | echo '</div>'; |
| 53 | 53 | } |
| 54 | 54 | echo '<div class="ultp-builder-wrap">'; |
| 55 | -if ( $page_id ) { | |
| 55 | +if ( $ultp_page_id ) { | |
| 56 | 56 | /* Content Filtering for elementor & divi */ |
| 57 | - $builder_type = ''; | |
| 58 | - $body_class = get_body_class(); | |
| 59 | - $divi_settings = ultimate_post()->get_setting( 'ultp_divi' ); | |
| 60 | - $elem_settings = ultimate_post()->get_setting( 'ultp_elementor' ); | |
| 61 | - if ( $divi_settings == 'true' && class_exists( 'ET_Builder_Module' ) && in_array( 'et-fb', $body_class ) ) { | |
| 62 | - $builder_type = 'divi'; | |
| 63 | - } elseif ( did_action( 'elementor/loaded' ) && $elem_settings == 'true' && in_array( 'elementor-editor-active', $body_class ) && in_array( 'elementor-editor-wp-post', $body_class ) ) { | |
| 64 | - $builder_type = 'elementor'; | |
| 57 | + $ultp_builder_type = ''; | |
| 58 | + $ultp_body_class = get_body_class(); | |
| 59 | + $ultp_divi_settings = ultimate_post()->get_setting( 'ultp_divi' ); | |
| 60 | + $ultp_elem_settings = ultimate_post()->get_setting( 'ultp_elementor' ); | |
| 61 | + if ( $ultp_divi_settings == 'true' && class_exists( 'ET_Builder_Module' ) && in_array( 'et-fb', $ultp_body_class ) ) { | |
| 62 | + $ultp_builder_type = 'divi'; | |
| 63 | + } elseif ( did_action( 'elementor/loaded' ) && $ultp_elem_settings == 'true' && in_array( 'elementor-editor-active', $ultp_body_class ) && in_array( 'elementor-editor-wp-post', $ultp_body_class ) ) { | |
| 64 | + $ultp_builder_type = 'elementor'; | |
| 65 | 65 | } |
| 66 | 66 | /* Content Filtering for elementor & divi */ |
| 67 | - ultimate_post()->get_post_content( $page_id, $builder_type ); | |
| 67 | + ultimate_post()->get_post_content( $ultp_page_id, $ultp_builder_type ); | |
| 68 | 68 | } else { |
| 69 | 69 | the_content(); |
| 70 | 70 | } |
| 71 | 71 | echo '</div>'; |
| 72 | -if ( $has_widget && $sidebar == 'right' ) { | |
| 72 | +if ( $ultp_has_widget && $ultp_sidebar == 'right' ) { | |
| 73 | 73 | echo '<div class="ultp-sidebar-right">'; |
| 74 | - if ( is_active_sidebar( $widget_area ) ) { | |
| 75 | - dynamic_sidebar( $widget_area ); | |
| 74 | + if ( is_active_sidebar( $ultp_widget_area ) ) { | |
| 75 | + dynamic_sidebar( $ultp_widget_area ); | |
| 76 | 76 | } |
| 77 | 77 | echo '</div>'; |
| 78 | 78 | } |
| 79 | 79 | echo '</div>'; |
| @@ -88,10 +88,10 @@ | ||
| 88 | 88 | <?php |
| 89 | 89 | if ( ! $ULTP_FOOTER_ID ) { |
| 90 | 90 | ob_start(); |
| 91 | 91 | block_template_part( 'footer' ); |
| 92 | - $footer = ob_get_clean(); | |
| 93 | - echo '<footer class="wp-block-template-part">' . $footer . '</footer>'; | |
| 92 | + $ultp_footer = ob_get_clean(); | |
| 93 | + echo '<footer class="wp-block-template-part">' . $ultp_footer . '</footer>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Core-rendered block template part. | |
| 94 | 94 | } |
| 95 | 95 | // wp_head(); |
| 96 | 96 | // wp_head(); all ready wp head declared in header, i can not find any conflict to check that, if you find any conflict for removing then use it |
| 97 | 97 | wp_footer(); |