Skip to content

[Fix] Various fixes #4411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions header-footer-grid/Core/Settings/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ public static function get_instance() {
/**
* Load settings/control group in customizer.
*
* @param string|null $group Group to load.
* @param \WP_Customize_Manager|null $customize_manager Manager object.
* @param string|null $group Group to load.
* @param \WP_Customize_Manager $customize_manager Manager object.
*
* @return \WP_Customize_Manager Customizer object.
*/
public function load( $group = null, \WP_Customize_Manager $customize_manager = null ) {
public function load( $group, \WP_Customize_Manager $customize_manager ) {
static $core_transports = [
'refresh' => true,
'postMessage' => true,
Expand Down
2 changes: 1 addition & 1 deletion inc/admin/hooks_upsells.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function render_custom_layouts_upsell_modal() {

/* ----- OVERLAY ----- */
.cl-overlay {
position: absolute;
position: fixed;
top: 0;
left: 0;
width: 100%;
Expand Down
40 changes: 40 additions & 0 deletions inc/compatibility/elementor.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,31 @@ public function add_theme_builder_hooks() {
return;
}

// Latest Elementor versions changed how they treat the theme locations.
// We need to rebuild the markup so we don't break the layout.
// @since 4.1
if ( ! $this->is_elementor_editor() ) {
add_action(
'elementor/theme/after_do_header',
function () {
do_action( 'neve_before_primary' );
echo '<main id="content" class="neve-main">';
do_action( 'neve_after_primary_start' );
},
PHP_INT_MAX
);

add_action(
'elementor/theme/before_do_footer',
function () {
do_action( 'neve_before_primary_end' );
echo '</main><!--/.neve-main-->';
do_action( 'neve_after_primary' );
},
PHP_INT_MIN
);
}

// Override theme templates.
add_action( 'neve_do_top_bar', array( $this, 'do_header' ), 0 );
add_action( 'neve_do_header', array( $this, 'do_header' ), 0 );
Expand Down Expand Up @@ -540,4 +565,19 @@ public function suspend_woo_customizations( $should_load, $class_name ) {

return ! $elementor_overrides;
}

/**
* Check if Elementor Editor.
*
* @since 4.1
*
* @return bool
*/
private function is_elementor_editor() {
if ( ( isset( $_REQUEST['action'] ) && 'elementor' === $_REQUEST['action'] ) || isset( $_REQUEST['elementor-preview'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
return true;
}

return false;
}
}
Loading