0

When visual editor is turned off, then $post->post_content is escaped. With visual editor turned on, the exact post content is obtained as saved.

enter image description here

When visual editor is ON, output of $post->post_content

enter image description here

When visual editor is OFF, output of $post->post_content

enter image description here

Now my problem is that I need to set this as content to <textarea> tag and I'm passing the $post->post_content through esc_textarea and because of above behavior the post content is sometimes double escaped as per user's settings.

I can't find out why post content is escaped when visual editor is turned off (or) how can I avoid double escape of the post_content and use the content as is ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.