diff --git a/src/wp-includes/class-wp-script-modules.php b/src/wp-includes/class-wp-script-modules.php index 9c9f8a762af5e..60db7c44b60f1 100644 --- a/src/wp-includes/class-wp-script-modules.php +++ b/src/wp-includes/class-wp-script-modules.php @@ -92,6 +92,18 @@ class WP_Script_Modules { */ private $modules_with_missing_dependencies = array(); + /** + * List of handles for classic scripts encountered which have missing script module dependencies. + * + * A handle is added to this list when it is discovered to have script module dependencies that are not + * registered. At this time, a warning is emitted with {@see _doing_it_wrong()}. The handle is then added to this + * list, so that duplicate warnings don't occur. + * + * @since 7.2.0 + * @var string[] + */ + private $classic_scripts_with_missing_module_dependencies = array(); + /** * Registers the script module if no script module with that script module * identifier has already been registered. @@ -367,7 +379,8 @@ public function set_translations( string $id, string $domain = 'default', string } /** - * Prints translations for all enqueued script modules. + * Prints translations for all enqueued script modules and for the script + * modules that classic scripts depend on. * * Outputs inline `