[wp-trac] Re: [WordPress Trac] #6380: the_excerpt & [gallery]

WordPress Trac wp-trac at lists.automattic.com
Sun Apr 6 09:49:39 GMT 2008


#6380: the_excerpt & [gallery]
----------------------------+-----------------------------------------------
 Reporter:  DD32            |        Owner:  anonymous
     Type:  defect          |       Status:  new      
 Priority:  normal          |    Milestone:  2.5.1    
Component:  Administration  |      Version:  2.5      
 Severity:  normal          |   Resolution:           
 Keywords:  has-patch       |  
----------------------------+-----------------------------------------------
Comment (by Denis-de-Bernardy):

 simpler fix:

 {{{

 # shortcodes
 add_filter('get_the_excerpt', 'strip_shortcodes', 0);
 add_filter('get_the_excerpt', 'restore_shortcodes', 20);

 function strip_shortcodes($in)
 {
         remove_filter('the_content', 'do_shortcode', 11);
         return $in;
 } # strip_shortcodes()


 function restore_shortcodes($in)
 {
         add_filter('the_content', 'do_shortcode', 11);
         return $in;
 } # restore_shortcodes()

 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6380#comment:9>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list