-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Script Modules API: Rename wp_module
functions to wp_script_module
#5869
Script Modules API: Rename wp_module
functions to wp_script_module
#5869
Conversation
wp...module
functions to wp...script_module
wp_module
functions to wp_script_module
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @luisherranz, LGTM!
Just one point of feedback: Maybe we should also update the function docs to say "script module" instead of just "module"?
Sure 🙂 Do you want me to remove the
Or maybe change them to
|
@luisherranz I think the latter, let's use |
I've renamed all the references to "modules" and replaced them with "script modules". |
wp_module
functions to wp_script_module
wp_module
functions to wp_script_module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested edits to phpdoc and added PHP 7 typing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks fine to me
Co-authored-by: Weston Ruter <[email protected]>
Thanks, @westonruter. I've applied all the necessary changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, though my proposal for including the array shape may need to go.
Co-authored-by: Weston Ruter <[email protected]>
Ok, everything looks good now. Thanks for your help, @westonruter 🙂 The PR is ready. |
…tions-to-script-modules
Trac ticket: https://core.trac.wordpress.org/ticket/56313
Renames all the mentions to "module" with "script module", including function names, comments, and tests.
The list of functions renamed are:
wp_module()
->wp_script_module()
wp_register_module()
->wp_register_script_module()
wp_enqueue_module()
->wp_enqueue_script_module()
wp_dequeue_module()
->wp_dequeue_script_module()
WP_Script_Modules::prints_enqueued_modules()
->WP_Script_Modules:: print_enqueued_script_modules()
WP_Script_Modules::print_module_preloads()
->WP_Script_Modules:: print_script_module_preloads()
It also adds PHP 7 typing to all the functions and improves the types of
$dependencies
argument ofwp_register_script_module
andwp_enqueue_script_module
using@type
.