[wp-hackers] Multiple the_editor uses potential patch

Jeremy Clarke jer at simianuprising.com
Wed Feb 17 16:19:10 UTC 2010


On Tue, Feb 16, 2010 at 4:21 AM, Ash Goodman <ash at thinkinginvain.com> wrote:
> I have built a site with multiple editors and its was a nightmare and full
> of problems from stripping our paragraph tags to display bugs on the resize
> grippy (I don't know what it's really called) at the bottom of the editor.

FWIW the removal of <p> tags makes sense, that is the way wordpress
saves content to the DB. It removes the <p> tags and replaces it with
whitespace that makes sense when you look at it (i.e. how it looks in
the editor). This way editing in the HTML editor isn't as ugly and it
even looks okay in the database. Then at display time the content is
passed through the_content filter where it gets run through wpautop()
which converts the whitespace to <p> tags.

If you want your custom content to act like normal post content then
just make sure to run wpautop() on the content before displaying it.
Better yet, just run the standard content filter on it:

 echo apply_filters('the_content', get_my_stuff());

That will make sure that [shortcodes] and other filtering gets
processed for your content just like posts.

-- 
Jeremy Clarke
Code and Design | globalvoicesonline.org


More information about the wp-hackers mailing list