is_elementor_editor() ) { return; } global $post; $id = astra_get_post_id(); $page_builder_flag = get_post_meta( $id, '_astra_content_layout_flag', true ); if ( isset( $post ) && empty( $page_builder_flag ) && ( is_admin() || is_singular() ) ) { if ( empty( $post->post_content ) && $this->is_elementor_activated( $id ) ) { update_post_meta( $id, '_astra_content_layout_flag', 'disabled' ); update_post_meta( $id, 'site-post-title', 'disabled' ); update_post_meta( $id, 'ast-title-bar-display', 'disabled' ); update_post_meta( $id, 'ast-featured-img', 'disabled' ); $content_layout = get_post_meta( $id, 'site-content-layout', true ); if ( empty( $content_layout ) || 'default' == $content_layout ) { update_post_meta( $id, 'site-content-layout', 'page-builder' ); } $sidebar_layout = get_post_meta( $id, 'site-sidebar-layout', true ); if ( empty( $sidebar_layout ) || 'default' == $sidebar_layout ) { update_post_meta( $id, 'site-sidebar-layout', 'no-sidebar' ); } // In the preview mode, Apply the layouts using filters for Elementor Template Library. add_filter( 'astra_page_layout', function() { return 'no-sidebar'; } ); add_filter( 'astra_get_content_layout', function () { return 'page-builder'; } ); add_filter( 'astra_the_post_title_enabled', '__return_false' ); add_filter( 'astra_featured_image_enabled', '__return_false' ); } } } /** * Add z-index CSS for elementor's drag drop * * @return void * @since 1.4.0 */ function elementor_overlay_zindex() { // return if we are not on Elementor's edit page. if ( ! $this->is_elementor_editor() ) { return; } ?> db->get_edit_mode( $id ) ); } else { return Plugin::$instance->db->is_built_with_elementor( $id ); } } /** * Check if Elementor Editor is open. * * @since 1.2.7 * * @return boolean True IF Elementor Editor is loaded, False If Elementor Editor is not loaded. */ private function is_elementor_editor() { if ( ( isset( $_REQUEST['action'] ) && 'elementor' == $_REQUEST['action'] ) || isset( $_REQUEST['elementor-preview'] ) ) { return true; } return false; } } endif; /** * Kicking this off by calling 'get_instance()' method */ Astra_Elementor::get_instance();