I’m showing little pieces of example HTML/PHP code on the frontend (with syntax highlighting). The entries are displayed as FAQ custom posts, and have a plugin (CMS Tree page) to alter the menu order, at which these are displayed. Whenever I change the order, it calls a wp_update_post
, updating ID
, menu_order
, post_parent
, post_type
. For debug, I output the post_content
property right before updating, and right after, and it gets changed in a horrible way.
Before (correct):
</body>After (messy):
</body>If I do it a couple of times it’ll become living hell to revert:
</body>It looks exactly like
htmlspecialchars()
withENT_NOQUOTES
has been cast on it…Please note that these are from the “source code” view and not the frontend. The browsers correctly handle the “Before” state, and render it as
</body>
How can I prevent it going messy?