[wp-trac] [WordPress Trac] #60597: Script Modules API: Allow list of enqueued module data to be exposed
WordPress Trac
noreply at wordpress.org
Tue Feb 27 08:44:32 UTC 2024
#60597: Script Modules API: Allow list of enqueued module data to be exposed
----------------------------+---------------------
Reporter: johnbillion | Owner: (none)
Type: task (blessed) | Status: new
Priority: normal | Milestone: 6.5
Component: Script Loader | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
----------------------------+---------------------
Comment (by luisherranz):
`get_marked_for_enqueue` and `get_dependencies` return a list of script
module arrays, not a list of script module identifiers (strings). Those
script module arrays are the arrays stored in `$registered`, and contain
all the internal information about a script module.
So instead of making the `$registered` arrays public, which would mean
they can't be refactored in the future, I would expose functions that
return the script module identifiers (strings) only. If you need more
information than that, like the corresponding src or dependencies of a
script module identifier, I would create additional public functions that
return a single piece of information (the src, the list of dependencies,
etc).
That's just my opinion, though.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60597#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list