array( string target_domain, string target_type, string semver ) )`. */ private static $domain_map = array(); /** * The registered package paths, by textdomain. * * Separate from `$domain_map` because the two answer different questions: * the map says which domain a package's strings are translated under, while * this says where the package's files live — the prefix WordPress hashes to * name a JS translation file. A package whose textdomain is already its * plugin's has nothing to alias but still needs the path. * * Note the entries are keyed by domain, not by script: `downloadI18n()` * prepends a domain's prefix to every bundle path looked up under it. That * is only ever one package's path, so a plugin must not both bundle a * package whose textdomain is the plugin's own and load its own * `wp-jp-i18n-loader` bundles under that same domain — the package's prefix * would be applied to the plugin's catalogs too, and they would all 404. No * plugin does both today. One that needs to should give the package a * distinct textdomain, the way `jetpack-backup-pkg` and * `jetpack-videopress-pkg` do. * * @var array `array( domain => array( string semver, string path_prefix ) )`. */ private static $domain_paths = array(); /** * Constructor. * * Static-only class, so nothing here. */ private function __construct() {} // //////////////////// // region Async script loading /** * Get the singleton instance of the class. * * @return Assets */ public static function instance() { if ( ! isset( self::$instance ) ) { self::$instance = new Assets(); } return self::$instance; } /** * A public method for adding the async script. * * @deprecated Since 2.1.0, the `strategy` feature should be used instead, with the "defer" setting. * * @param string $script_handle Script handle. */ public static function add_async_script( $script_handle ) { _deprecated_function( __METHOD__, '2.1.0' ); wp_script_add_data( $script_handle, 'strategy', 'defer' ); } /** * Add an async attribute to scripts that can be loaded deferred. * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script * * @deprecated Since 2.1.0, the `strategy` feature should be used instead. * * @param string $tag The