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
Adds documentation for WordPress.WP.EnqueuedResources. #1824
Adds documentation for WordPress.WP.EnqueuedResources. #1824
Conversation
0efe230
to
b6e50ae
Compare
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.
Hi @NielsdeBlaauw Looking good.
I've left some small remarks inline.
Aside from that, I'm wondering if it would be better for the example code to reference local files instead of external URLs, as that is (or should be) the more common use-case.
For plugins, this would be something like:
plugins_url( 'css/my-css.css', __FILE__ ),
And for themes:
get_template_directory_uri() . '/js/nav.js'
I'm worried the code for the invalid example might be too far from what the user is actually doing, or what the sniff will be picking up. It's not about what resource is loaded, it is more about the way it is being done. IMHO this example is easier and more accessible to people with limited knowledge of WP. Also it avoids a discussion of where the actual resource is coming from. |
True enough. Maybe using a The reason I'm not keen to leave the examples with the URLs is two-fold and revolves around other problems which this sniff is not sniffing for:
These are issues outside the scope of the sniff, so I agree that we shouldn't address them here, but I do believe showing code which we may well forbid at a later stage, is not a good idea either. |
Agree, I'm going to replace it with a variable. |
542ce59
to
9bd5f9c
Compare
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.
👍
Related to #1722