Just wanted to let you know about an issue we ran into and show you how we fixed it.
Basically, the function to sanitize the customizer setting for the Google Analytics code in "Footer Options" was stripping all the script tags because it was using wp_kses_post( $html ). That only allows tags default $allowed_tags for post content.
We had to create another function for the sanitizer.php file. It is as follows:
Hi folks,
Just wanted to let you know about an issue we ran into and show you how we fixed it.
Basically, the function to sanitize the customizer setting for the Google Analytics code in "Footer Options" was stripping all the script tags because it was using wp_kses_post( $html ). That only allows tags default $allowed_tags for post content.
We had to create another function for the sanitizer.php file. It is as follows:
Then, in the 09-footer.php file, we changed the callback from 'html' to the following:
We also noticed that the "section" assigned to the header code was the footer, not the header. In 03-header.php, we changed the following section to:
That also has to be sanitized for the allowed script tags.
Prior, it would echo out the analytics code minus the tags in the footer, which was visible below the footer to users/visitors.
These two urls were solid resources for this fix:
https://gist.github.com/ControlledChaos/a68997f4a348d447132033332a4e50f1
https://divpusher.com/blog/wordpress-customizer-sanitization-examples
Hi,
Thank you for your feedback. We're appreciate that.
I will send that issues for our developers and tell with them to check and fixed it No worries.
Best Regards,
PenciDesign
Most welcome! I updated it to add two urls that helped us.