✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ server366.web-hosting.com ​🇻​♯➤ 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 67.223.118.204 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.243
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/builxejc/public_html/wp-content/plugins/elementor/core/utils//force-locale.php
<?php
namespace Elementor\Core\Utils;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Force translation to use a specific locale.
 *
 * A hacky class to force any translation functions in the call-stack between the
 * `force()` & `reset()` methods to use a specific locale.
 */
class Force_Locale {

	/**
	 * @var string Locale to force (e.g. `he_IL`).
	 */
	private $new_locale;

	/**
	 * @var string Original locale before forcing.
	 */
	private $original_locale;

	/**
	 * @var \WP_Textdomain_Registry
	 */
	private $original_textdomain_registry;

	/**
	 * @var \Closure Filter reference `pre_determine_locale`.
	 */
	private $filter;

	public function __construct( $new_locale, $original_locale = null ) {
		$this->new_locale = $new_locale;

		$this->original_locale = $original_locale ? $original_locale : determine_locale();

		$this->filter = function() use ( $new_locale ) {
			return $new_locale;
		};
	}

	/**
	 * Force the translations to use a specific locale.
	 *
	 * @return void
	 */
	public function force() {
		switch_to_locale( $this->new_locale );

		/**
		 * Reset the \WP_Textdomain_Registry instance to clear its cache.
		 *
		 * @see https://github.com/WordPress/wordpress-develop/blob/799d7dc86f5b07b17f7a418948fc851bd2fc334b/src/wp-includes/class-wp-textdomain-registry.php#L179-L187
		 * @see https://github.com/WordPress/wordpress-develop/blob/799d7dc86f5b07b17f7a418948fc851bd2fc334b/tests/phpunit/tests/l10n/wpLocaleSwitcher.php#L19-L31
		 */
		$this->reset_textdomain_registry();

		/**
		 * Reset l10n in order to clear the translations cache.
		 *
		 * @see https://github.com/WordPress/wordpress-develop/blob/2437ef5130f10153bc4fffa412d4f37e65e3d66b/src/wp-includes/l10n.php#L1324
		 * @see https://github.com/WordPress/wordpress-develop/blob/2437ef5130f10153bc4fffa412d4f37e65e3d66b/src/wp-includes/l10n.php#L1222
		 * @see https://github.com/WordPress/wordpress-develop/blob/2437ef5130f10153bc4fffa412d4f37e65e3d66b/src/wp-includes/l10n.php#L821
		 */
		$this->reset_l10n();

		/**
		 * Force the translations of `$new_locale` to be loaded.
		 *
		 * @see https://github.com/WordPress/wordpress-develop/blob/2437ef5130f10153bc4fffa412d4f37e65e3d66b/src/wp-includes/l10n.php#L1294
		 */
		add_filter( 'pre_determine_locale', $this->filter );
	}

	/**
	 * Restore the original locale and cleanup filters, etc.
	 *
	 * @return void
	 */
	public function restore() {
		$this->restore_textdomain_registry();

		$this->reset_l10n();

		switch_to_locale( $this->original_locale );

		remove_filter( 'pre_determine_locale', $this->filter );
	}

	private function reset_textdomain_registry() {
		if ( ! class_exists( '\WP_Textdomain_Registry' ) ) {
			return;
		}

		/** @var \WP_Textdomain_Registry $wp_textdomain_registry */
		global $wp_textdomain_registry;

		$this->original_textdomain_registry = $wp_textdomain_registry;

		$wp_textdomain_registry = new \WP_Textdomain_Registry();
	}

	private function restore_textdomain_registry() {
		if ( ! $this->original_textdomain_registry ) {
			return;
		}

		/** @var \WP_Textdomain_Registry $wp_textdomain_registry */
		global $wp_textdomain_registry;

		$wp_textdomain_registry = $this->original_textdomain_registry;
	}

	/**
	 * Reset the l10n global variables.
	 *
	 * @return void
	 */
	private function reset_l10n() {
		global $l10n, $l10n_unloaded;

		if ( is_array( $l10n ) ) {
			foreach ( $l10n as $domain => $l10n_data ) {
				unset( $l10n[ $domain ] );
			}
		}

		if ( is_array( $l10n_unloaded ) ) {
			foreach ( $l10n_unloaded as $domain => $l10n_unloaded_data ) {
				unset( $l10n_unloaded[ $domain ] );
			}
		}
	}
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
9 Jun 2026 8.37 AM
builxejc / builxejc
0755
api
--
9 Jun 2026 8.37 AM
builxejc / builxejc
0755
import-export
--
9 Jun 2026 8.37 AM
builxejc / builxejc
0755
promotions
--
9 Jun 2026 8.37 AM
builxejc / builxejc
0755
svg
--
9 Jun 2026 8.37 AM
builxejc / builxejc
0755
ab-test.php
2.446 KB
15 Sep 2025 2.10 PM
builxejc / builxejc
0644
assets-config-provider.php
1.486 KB
23 Aug 2023 5.47 PM
builxejc / builxejc
0644
assets-translation-loader.php
2.508 KB
21 Oct 2025 4.51 PM
builxejc / builxejc
0644
collection.php
10.133 KB
22 Dec 2025 5.25 PM
builxejc / builxejc
0644
exceptions.php
0.692 KB
17 Mar 2025 5.28 PM
builxejc / builxejc
0644
force-locale.php
3.555 KB
23 Apr 2023 3.22 PM
builxejc / builxejc
0644
hints.php
14.66 KB
30 Mar 2026 1.49 PM
builxejc / builxejc
0644
http.php
0.958 KB
23 Apr 2023 3.22 PM
builxejc / builxejc
0644
plugins-manager.php
2.84 KB
28 Apr 2025 11.15 AM
builxejc / builxejc
0644
static-collection.php
1.086 KB
21 Oct 2025 4.51 PM
builxejc / builxejc
0644
str.php
0.978 KB
17 Mar 2025 5.28 PM
builxejc / builxejc
0644
template-library-element-iterator.php
0.748 KB
30 Mar 2026 1.49 PM
builxejc / builxejc
0644
template-library-import-export-utils.php
7.196 KB
30 Mar 2026 1.49 PM
builxejc / builxejc
0644
template-library-snapshot-processor.php
6.761 KB
20 May 2026 4.19 PM
builxejc / builxejc
0644
version.php
3.778 KB
21 Oct 2025 4.51 PM
builxejc / builxejc
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF