[wp-hackers] Re: filter the_exceprt

Jeremy Clarke jer at simianuprising.com
Wed Jan 14 19:43:48 GMT 2009


I think that get_the_excerpt and the_excerpt are both pretty lame
actually. How is it that the right amount of parameters for these
functions is zero? There used to be a parameter but now its gone?

 249  function get_the_excerpt($deprecated = '') {

If nothing else, it should allow for fetching the excerpt from
arbitrary post_id's. It also seems very clear that defining the
character length of automatic excerpts would be very very useful to
have access to at this point (so that any excerpts you fail to input,
which happens believe me, are about as long as your average manual
excerpts). Then finally as mentioned the elipsis string would be very
useful, giving something like:

function get_the_excerpt($post_id = NULL, $length = 50, $after = '[...]')

As it is all the default formatting happens i guess through WP adding
its own filters on the_excerpt, which is nice because plugins can
override the behavior, but is hard for normal users to get their heads
around. They are used to giving parameters to template tags and I
think this is a case where making that work would be very useful.

If there's an issue with the deprecated parameter I think we might as
well switch to get_excerpt() instead of get_THE_excerpt(), the former
is more in tune with WP's naming conventions anyway IMHO.

-- 
Jeremy Clarke
Code and Design | globalvoicesonline.org


More information about the wp-hackers mailing list