Current Path: > home > transcarter > > www > > wp-content > plugins > elementor > core > utils
Operation : Linux host59.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64 Software : Apache Server IP : 198.54.126.42 | Your IP: 216.73.216.135 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
import-export | Directory | - | - | |
promotions | Directory | - | - | |
svg | Directory | - | - | |
assets-config-provider.php | File | 1522 bytes | July 17 2025 21:06:23. | |
assets-translation-loader.php | File | 2560 bytes | July 17 2025 21:06:23. | |
collection.php | File | 10116 bytes | July 17 2025 21:06:23. | |
exceptions.php | File | 709 bytes | July 17 2025 21:06:23. | |
force-locale.php | File | 3640 bytes | July 17 2025 21:06:23. | |
hints.php | File | 10506 bytes | July 17 2025 21:06:23. | |
http.php | File | 981 bytes | July 17 2025 21:06:23. | |
isolation-manager.php | File | 415 bytes | July 17 2025 21:06:23. | |
plugins-manager.php | File | 2908 bytes | July 17 2025 21:06:23. | |
static-collection.php | File | 1111 bytes | July 17 2025 21:06:23. | |
str.php | File | 1001 bytes | July 17 2025 21:06:23. | |
version.php | File | 3749 bytes | July 17 2025 21:06:23. |
<?php namespace Elementor\Core\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class Assets_Translation_Loader { public static function for_handles( array $handles, $domain = null, $replace_callback = null ) { self::set_domain( $handles, $domain ); self::replace_translation_path( $handles, $replace_callback ); } private static function set_domain( array $handles, $domain = null ) { if ( empty( $domain ) || ! is_string( $domain ) ) { return; } foreach ( $handles as $handle ) { wp_set_script_translations( $handle, $domain ); } } /** * The purpose of this function is to replace the requested translation file * with a file that contains all the translations for specific scripts. * * When developing a module and using Webpack's dynamic load feature, the script will be split into multiple chunks. * As a result, the WordPress translations expressions will also be split into multiple files. * Therefore, we replace the requested translation file with another file (generated in the build process) * that contains all the translations for the specific script (including dynamically loaded chunks). * * Want to go deeper? Read the following article: * * @see https://developer.wordpress.com/2022/01/06/wordpress-plugin-i18n-webpack-and-composer/ * * @param array $handles * @param callable|null $replace_callback */ private static function replace_translation_path( array $handles, $replace_callback = null ) { $sources = self::map_handles_to_src( $handles ); add_filter( 'load_script_textdomain_relative_path', function ( $relative_path, $src ) use ( $sources, $replace_callback ) { if ( ! in_array( $src, $sources, true ) ) { return $relative_path; } if ( is_callable( $replace_callback ) ) { return $replace_callback( $relative_path, $src ); } return self::default_replace_translation( $relative_path ); }, 10, 2 ); } private static function map_handles_to_src( array $handles ) { return array_map( function ( $handle ) { return wp_scripts()->registered[ $handle ]->src; }, $handles ); } private static function default_replace_translation( $relative_path ) { // Translations are always based on the non-minified filename. $relative_path_without_ext = preg_replace( '/(\.min)?\.js$/i', '', $relative_path ); // By default, we suffix the file with `.strings` (e.g 'assets/js/editor.js' => 'assets/js/editor.strings.js'). return implode( '.', [ $relative_path_without_ext, 'strings', 'js', ] ); } }
SILENT KILLER Tool