is_preview_mode() ) { return; } if ( isset( $_GET['preview-debug'] ) ) { register_shutdown_function( function () { $e = error_get_last(); if ( $e ) { echo '
';
					Utils::print_unescaped_internal_string( $e['message'] );
					echo '
'; } } ); } $this->post_id = get_the_ID(); $this->is_preview = true; // Don't redirect to permalink. remove_action( 'template_redirect', 'redirect_canonical' ); // Compatibility with Yoast SEO plugin when 'Removes unneeded query variables from the URL' enabled. // TODO: Move this code to `includes/compatibility.php`. if ( class_exists( 'WPSEO_Frontend' ) ) { remove_action( 'template_redirect', [ \WPSEO_Frontend::get_instance(), 'clean_permalink' ], 1 ); } // Disable the WP admin bar in preview mode. add_filter( 'show_admin_bar', '__return_false' ); add_action( 'wp_enqueue_scripts', function() { $this->enqueue_styles(); $this->enqueue_scripts(); }, self::ENQUEUED_STYLES_PRIORITY ); add_filter( 'the_content', [ $this, 'builder_wrapper' ], 999999 ); add_action( 'wp_footer', [ $this, 'wp_footer' ] ); // Avoid Cloudflare's Rocket Loader lazy load the editor iframe add_filter( 'script_loader_tag', [ $this, 'rocket_loader_filter' ], 10, 3 ); // Tell to WP Cache plugins do not cache this request. Utils::do_not_cache(); /** * Preview init. * * Fires on Elementor preview init, after Elementor preview has finished * loading but before any headers are sent. * * @since 1.0.0 * * @param Preview $this The current preview. */ do_action( 'elementor/preview/init', $this ); } /** * Retrieve post ID. * * Get the ID of the current post. * * @since 1.8.0 * @access public * * @return int Post ID. */ public function get_post_id() { return $this->post_id; } /** * Is Preview. * * Whether current request is the elementor preview iframe. * The flag is not related to a specific post or edit permissions. * * @since 2.9.5 * @access public * * @return bool */ public function is_preview() { return $this->is_preview; } /** * Whether preview mode is active. * * Used to determine whether we are in the preview mode (iframe). * * @since 1.0.0 * @access public * * @param int $post_id Optional. Post ID. Default is `0`. * * @return bool Whether preview mode is active. */ public function is_preview_mode( $post_id = 0 ) { if ( ! isset( $_GET['elementor-preview'] ) ) { return false; } if ( empty( $post_id ) ) { $post_id = get_the_ID(); } if ( ! User::is_current_user_can_edit( $post_id ) ) { return false; } if ( $post_id !== (int) $_GET['elementor-preview'] ) { return false; } return true; } /** * Builder wrapper. * * Used to add an empty HTML wrapper for the builder, the javascript will add * the content later. * * @since 1.0.0 * @access public * * @param string $content The content of the builder. * * @return string HTML wrapper for the builder. */ public function builder_wrapper( $content ) { if ( get_the_ID() === $this->post_id ) { $document = Plugin::$instance->documents->get( $this->post_id ); $attributes = $document->get_container_attributes(); $content = '
'; } return $content; } /** * Enqueue preview styles. * * Registers
Fatal error: Uncaught Error: Class "Elementor\Preview" not found in /home3/geotrans/public_html/wp-content/plugins/elementor/includes/plugin.php:699 Stack trace: #0 /home3/geotrans/public_html/wp-content/plugins/elementor/includes/plugin.php(621): Elementor\Plugin->init_components() #1 /home3/geotrans/public_html/wp-includes/class-wp-hook.php(341): Elementor\Plugin->init() #2 /home3/geotrans/public_html/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters() #3 /home3/geotrans/public_html/wp-includes/plugin.php(522): WP_Hook->do_action() #4 /home3/geotrans/public_html/wp-settings.php(742): do_action() #5 /home3/geotrans/public_html/wp-config.php(110): require_once('/home3/geotrans...') #6 /home3/geotrans/public_html/wp-load.php(50): require_once('/home3/geotrans...') #7 /home3/geotrans/public_html/wp-blog-header.php(13): require_once('/home3/geotrans...') #8 /home3/geotrans/public_html/index.php(17): require('/home3/geotrans...') #9 {main} thrown in /home3/geotrans/public_html/wp-content/plugins/elementor/includes/plugin.php on line 699