Whenever adding an empty line between paragraphs using TinyMCE, the
character entity is added.
How can I strip the content of all instances of this character whenever an author updates their post (save_post
)?
Whenever adding an empty line between paragraphs using TinyMCE, the
character entity is added.
How can I strip the content of all instances of this character whenever an author updates their post (save_post
)?
You must be logged in to post a comment.
Figured it out, hooking into
content_save_pre
:I liked your solution but it might happen to be that the ” ” is legit or intended in some part of the content further down in the content structure. The problem – at least for me – only occurs for the unnecessary and annoying extra lines at the beginning of the content.
So I decided to extend your solution by only removing the extra “nonBreakingSpaces” at the very beginning of the text before any further tags occur: