Skip to content

Remove JS escaping from amp_post_template_analytics filter callback #22

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

doubleswirve
Copy link

Removes some extraneous calls to esc_js in the amp_post_template_analytics filter callback as the nested config_data array is already JSON encoded, when printed out to the page, in the AMP plugin:

Also the esc_js calls don't seem to be as useful since the output goes to the contents of a application/json script element (i.e., not inline JavaScript):

Escapes text strings for echoing in JS. It is intended to be used for inline JS (in a tag attribute, for example onclick="…")

https://developer.wordpress.org/reference/functions/esc_js/

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant