Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

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

share|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 '12 at 19:29
    
Quick update ^ WP Codex has been fixed and no longer refers to convertEntities. –  Jeremy Ferguson Jun 10 '13 at 18:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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