| 1 |
<?php |
| 2 |
|
| 3 |
global $__composer_autoload_files, $wp_one_package_versions; |
| 4 |
|
| 5 |
/** |
| 6 |
* Allow this file to be executed multiple times across different plugin instances. |
| 7 |
* |
| 8 |
* This package may be bundled with multiple plugins, and each plugin needs to register |
| 9 |
* its version. By default, Composer's autoloader prevents the same file from being loaded |
| 10 |
* more than once. To enable re-execution, we remove this file from Composer's global |
| 11 |
* registry of loaded files ($__composer_autoload_files). |
| 12 |
* |
| 13 |
* Process: |
| 14 |
* 1. Locate the vendor directory (2 levels up when installed as a Composer package) |
| 15 |
* 2. Load Composer's autoload files map (hash => file path mappings) |
| 16 |
* 3. Find this file's unique hash ID in the map |
| 17 |
* 4. Remove the hash from the loaded files registry to allow subsequent executions |
| 18 |
*/ |
| 19 |
$vendor_dir = dirname( __DIR__, 2 ); |
| 20 |
$autoload_files_path = $vendor_dir . '/composer/autoload_files.php'; |
| 21 |
|
| 22 |
if ( file_exists( $autoload_files_path ) ) { |
| 23 |
$autoload_files_map = require $autoload_files_path; |
| 24 |
$autoload_files_id = array_search( __FILE__, $autoload_files_map, true ); |
| 25 |
|
| 26 |
if ( false !== $autoload_files_id && isset( $__composer_autoload_files[ $autoload_files_id ] ) ) { |
| 27 |
unset( $__composer_autoload_files[ $autoload_files_id ] ); |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
$pattern = '#/([^/]+)/vendor/elementor/#'; |
| 32 |
if ( preg_match( $pattern, __DIR__, $matches ) ) { |
| 33 |
$wp_one_package_versions[ $matches[1] ] = '1.0.55'; |
| 34 |
} |
| 35 |
|
| 36 |
if ( ! function_exists( 'elementor_one_register_1_dot_0_dot_55' ) && function_exists( 'add_action' ) ) { |
| 37 |
|
| 38 |
if ( ! class_exists( '\ElementorOne\Versions', false ) ) { |
| 39 |
require_once __DIR__ . '/src/Versions.php'; |
| 40 |
add_action( 'plugins_loaded', [ \ElementorOne\Versions::class, 'initialize_latest_version' ], -15, 0 ); |
| 41 |
} |
| 42 |
|
| 43 |
add_action( 'plugins_loaded', 'elementor_one_register_1_dot_0_dot_55', -20, 0 ); |
| 44 |
|
| 45 |
function elementor_one_register_1_dot_0_dot_55() { |
| 46 |
$versions = \ElementorOne\Versions::instance(); |
| 47 |
$versions->register( '1.0.55', 'elementor_one_initialize_1_dot_0_dot_55' ); |
| 48 |
} |
| 49 |
|
| 50 |
function elementor_one_initialize_1_dot_0_dot_55() { |
| 51 |
// The Loader class will be autoloaded from the highest version source |
| 52 |
\ElementorOne\Loader::init(); |
| 53 |
} |
| 54 |
} |
| 55 |
|