array( string target_domain, string target_type, string semver, string path_prefix ) )`. */ private static $domain_map = 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(); self::$instance->init_hooks(); } return self::$instance; } /** * Initalize the hooks as needed. */ private function init_hooks() { /* * Load some scripts asynchronously. */ add_filter( 'script_loader_tag', array( $this, 'script_add_async' ), 10, 2 ); } /** * A public method for adding the async script. * * @param string $script_handle Script handle. */ public static function add_async_script( $script_handle ) { $assets_instance = self::instance(); $assets_instance->defer_script_handles[] = $script_handle; } /** * Add an async attribute to scripts that can be loaded deferred. * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script * * @param string $tag The