I have the following two snippets of code that render the custom code in the header.php
and footer.php
:
<!-- code before closing head tag -->
<?php echo $x_redux_option['x_code_before_head']; ?>
<!-- code before closing body tag -->
<?php echo $x_code_before_body; ?>
The data is coming from the redux framework
dynamically.
And the options only accept code wrapped with script tags
and HTML markup
that is valid inside the <head> tag for header
and valid HTML markup for footer
.
The fact is that the Mentor Themeforest
shows the following errors:
-
All dynamic data must be correctly escaped for the context where it is rendered. at file
header.php
, line 39: -
All dynamic data must be correctly escaped for the context where it is rendered. at file
footer.php
, line 44:
How can I escape this data?
Will I use the wp_kses()
function?
But which HTML tags
should I allow?
How can I know which tags should be allowed?
Please, extend your helping hand as before. :) Thank you so much for taking the trouble to read.