I was using the javascript function convertEntities in a plugin that worked great until recently and now the function seems to have vanished under 3.3 - Is there a substitute function I should be using?

I am tempted to just copy the function into my script - is there a reason that is a bad idea?

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

convertEntities was removed because strings are passed to JavaScript via json_encode() now:

http://core.trac.wordpress.org/ticket/11520

link|improve this answer
To clarify the above, all I had to do was remove the convertEntities function from my script and everything started working as before. Thanks!! The codex is now outdated here: codex.wordpress.org/Function_Reference/wp_localize_script , where at the bottom it says you need to use convertEntities to convert the object variable from string to HTML format. – Jeremy Ferguson Jan 9 at 19:29
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.