WordPress.org

Ready to get started?Download WordPress

Forums

update() adding p tags with e-circumflex (1 post)

  1. Sam Brodie
    Member
    Posted 2 years ago #

    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|&nbsp;?)*</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?

Topic Closed

This topic has been closed to new replies.

About this Topic