WordPress replace character output that breaks my script
-
I’m using wordpress 4.2.2 and i found a very weird problem. On a plugin i found the plugin author print an output for something like this:
echo ' if (responsiveEntries!=undefined && responsiveEntries.length>0)'."\n"; echo ' jQuery.each(responsiveEntries, function(index,obj) {'."\n"; echo ' var curw = obj.width != undefined ? obj.width : 0,'."\n"; echo ' cura = obj.amount != undefined ? obj.amount : 0;'."\n"; ......etc
The problem arise on the frontend, when i debug, the output is become something like this:
`if (responsiveEntries!=undefined && responsiveEntries.length>0)
jQuery.each(responsiveEntries, function(index,obj) {
var curw = obj.width != undefined ? obj.width : 0,
cura = obj.amount != undefined ? obj.amount : 0;`As you can see.. the character && is replace by the safe character (& #038;).. it brokes the script… i’m wondering how to debug this issue, i already turn off unnecessary plugin and the problem is there.. so i believe its related with the themes or core wordpress
the problem only happen on post or custom post type.. when i put the shortcode on pages.. there’s no problem
Any thought ?
- The topic ‘WordPress replace character output that breaks my script’ is closed to new replies.