mirrored from git://develop.git.wordpress.org/
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script Loader: Allow for
wp_register_script()
to be called after `w…
…p_enqueue_script()`. When a plugin registers styles/scripts on `wp_enqueue_scripts` (as plugin authors are encouraged to do), and conditionally enqueues their script/style on `the_content` filter, things "just work". In block themes, `the_content` is run prior to the header being processed, which results in the above scenario failing. This change makes a `wp_enqueue_script( 'example' ); wp_register_script( 'example' );` work, where as currently the enqueue silently fails (no "doing it wrong" message) and the following register has no impact. Scripts can therefore be enqueued and dequeued (by "handle") before they are registered. Fixes #54529. git-svn-id: https://develop.svn.wordpress.org/trunk@52338 602fd350-edb4-49c9-b593-d223f7449a82
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters