wp-includes/class-wp-script-modules.php:26Core class used to register script modules.
Every hook that fires from inside WP_Script_Modules, in the order it appears in the class, grouped by the method that fires it.
$registeredarray<string,private$queuestring[]private$donestring[]private$a11y_availableboolprivate$dependents_maparray<string,private$prioritiesstring[]private$modules_with_missing_dependenciesstring[]privateclass WP_Script_Modules { /** * Holds the registered script modules, keyed by script module identifier. * * @since 6.5.0 * @var array<string, array<string, mixed>> * @phpstan-var array<string, ScriptModule> */ private $registered = array(); /** * An array of IDs for queued script modules. * * @since 6.9.0 * @var string[] */ private $queue = array(); /** * Holds the script module identifiers that have been printed. * * @since 6.9.0 * @var string[] */ private $done = array(); /** * Tracks whether the @wordpress/a11y script module is available. * * Some additional HTML is required on the page for the module to work. Track * whether it's available to print at the appropriate time. * * @since 6.7.0 * @var bool */ private $a11y_available = false; /** * Holds a mapping of dependents (as IDs) for a given script ID. * Used to optimize recursive dependency tree checks. * * @since 6.9.0 * @var array<string, string[]> */ private $dependents_map = array(); /** * Holds the valid values for fetchpriority. * * @since 6.9.0 * @var string[] */ private $priorities = array( 'low', 'auto', 'high', ); /** * List of IDs for script modules encountered which have missing dependencies. * * An ID is added to this list when it is discovered to have missing dependencies. At this time, a warning is * emitted with {@see _doing_it_wrong()}. The ID is then added to this list, so that duplicate warnings don't occur. * * @since 6.9.1 * @var string[] */ private $modules_with_missing_dependencies = array(); /** * Registers the script module if no script module with that script module * identifier has already been registered. * * @since 6.5.0 * @since 6.9.0 Added the $args parameter. * * @param string $id The identifier of the script module. Should be unique. It will be used in the * final import map. * @param string $src Optional. Full URL of the script module, or path of the script module relative * to the WordPress root directory. If it is provided and the script module hasIntroduced in 6.5.0. 14 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
set_translations() added.verified against sourceprint_script_module_translations() added.verified against sourceget_registered() added.verified against sourceget_queue() added.verified against sourceis_valid_fetchpriority() added.verified against sourceset_fetchpriority() added.verified against sourceset_in_footer() added.verified against sourceget_highest_fetchpriority() added.verified against sourceprint_head_enqueued_script_modules() added.verified against sourceprint_script_module() added.verified against sourceget_dependents() added.verified against sourceget_recursive_dependents() added.verified against sourceget_sorted_dependencies() added.verified against sourcesort_item_dependencies() added.verified against sourcesrc/wp-includes/class-wp-script-modules.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.