[wp-hackers] Re: filter the_exceprt

Lynne Pope lynne.pope at gmail.com
Tue Jan 13 23:10:41 GMT 2009


2009/1/14 Stephanie Leary <steph at sillybean.net>

> Hi, Lynne. I don't want to shout you down at all because for the most part
> we agree. The main reason I use the Reloaded plugin is to circumvent the
> tag stripping that occurs with the built-in excerpt function. I do write my
> own excerpts most of the time -- but they contain links, images, and lists
> that I need to preserve when the excerpt is called.
>
>
Is all this tag stripping coming from wpautop and wptexturize alone?

It's probably just dumb luck but (so far) all my clients have wanted the
editor off and since I work that way too I haven't run into issues with the
editor. I also routinely remove formatting, using this:

remove_filter ('the_content',  'wpautop');
remove_filter ('comment_text', 'wpautop');
remove_filter('the_content', 'wptexturize');
remove_filter('the_excerpt', 'wptexturize');
remove_filter('comment_text', 'wptexturize');
remove_filter('the_title', 'wptexturize');

As a result, I have excerpts formatted the way I like, with all HTML code
intact, without the use of a plugin.

Pros: Works well for those of us who want complete control over our own
HTML.

Cons: Absolutely the wrong thing for the masses.

It seems to me that formatting.php could be made friendlier. For example, if
anyone wants to remove some of wptexturize but keep other parts of the
filter they have only two choices - hack the core or remove the filter and
add their own.
Perhaps what is needed isn't so much an addition of Excerpt Reloaded as the
addition of an option within admin settings to enable wptexturize filters or
not, for content, excerpt and comments?

Lynne


More information about the wp-hackers mailing list