Skip to content
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

[wp compliance] new strategy for inline printing of scripts and stylesheets #887

Closed
ghost opened this issue Apr 1, 2022 · 0 comments
Closed

Comments

@ghost
Copy link

ghost commented Apr 1, 2022

Some scripts and stylesheets of the plugin needs to be printed inline and are not added to an alread registered script.
Classic Editor plugin does it for example here : classic-editor.php#L416
Another popular plugin, Beaver Builder does it too for example here : https://plugins.trac.wordpress.org/browser/beaver-builder-lite-version/trunk/classes/class-fl-builder.php#L763

For scripts that need to be printed inline and not added to an already registered script, it iscompliant to use wp_print_inline_script_tag() as described here : https://developer.wordpress.org/reference/functions/wp_add_inline_script/#comment-5304 => Important : this can't be done in footer hooks. It would be too late

@ghost ghost added the [Priority : critical] label Apr 1, 2022
@ghost ghost self-assigned this Apr 1, 2022
@ghost ghost added the Needs specifications Specifications missing label Apr 1, 2022
ghost pushed a commit that referenced this issue Apr 2, 2022
ghost pushed a commit that referenced this issue Apr 2, 2022
ghost pushed a commit that referenced this issue Apr 2, 2022
ghost pushed a commit that referenced this issue Apr 2, 2022
ghost pushed a commit that referenced this issue Apr 2, 2022
@ghost ghost added the Needs tests label Apr 3, 2022
ghost pushed a commit that referenced this issue Apr 3, 2022
@ghost ghost added done and removed Needs specifications Specifications missing labels Apr 5, 2022
@ghost ghost closed this as completed Apr 8, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants