[wp-trac] [WordPress Trac] #7100: don't parse shortcodes in excerpts
WordPress Trac
wp-trac at lists.automattic.com
Thu Jun 5 14:07:00 GMT 2008
#7100: don't parse shortcodes in excerpts
---------------------+------------------------------------------------------
Reporter: hailin | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.7
Component: General | Version:
Severity: normal | Keywords:
---------------------+------------------------------------------------------
some themes display excerpts by calling the_excerpt(), which calls
get_the_excerpt, then if there is no original excerpt, call
apply_filters('get_the_excerpt', $output). Eventually wp_trim_excerpt() is
called, and apply_filters('the_content', $text). The issue is that
the_content filter parses shortcode such as [video ..] or [audio ..], and
the result is truncated to 55 words, producing ugly output
<eagleclaw2> I am proposing not to parse, nor to display, shortcode in
wp_trim_excerpt. But then we need to enumerate and skip every type of
shortcode ... not pretty..
<rboren> eagleclaw2: Temporarily remove shortcode from the_content filter
for wp_trim_excerpt()?
<rboren> That would leave use with raw shortcodes.
<rboren> But, we might need to write strip_shortcodes() at some point.
<eagleclaw2> you mean to strip all the shortcodes, given a raw post ?
<rboren> Something analogous to strip_tags() to be used in similar
situations.
<rboren> Just wondering out loud. :-)
<eagleclaw2> agreed. let me attemp to write strip_shortcodes()
--
Ticket URL: <http://trac.wordpress.org/ticket/7100>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list