I’m working on a front-end editing solution for WordPress using the new wp_editor() function in WP 3.3. Everything is working great, except when I save the content to the database, WordPress seems to be adding <p>Ê</p> to the end of the string that I’m saving.
The content shows as <p> </p> but when I copied it from the database and echoed it, I realized that the space was actually an e-circumflex (Ê) character.
Before I figured out that the space was actually an e-circumflex, I was trying to clean the p tags with preg_replace('#<p[^>]*>(\s| ?)*</p>#', '', $data); That didn’t work.
Then, I tried to clean the input using $input = mb_ereg_replace("<p>Ê</p>","",$input); which worked in a simple test case, but didn’t work when I added the complexity of saving the input to the database.
I’ve been working for days trying to figure this out and I’m hoping that someone can help me out before I tear out the rest of my hair. Any ideas?
The topic ‘update() adding p tags with e-circumflex’ is closed to new replies.