[wp-trac] Re: [WordPress Trac] #8480: apply_filters('post_gallery', '', $attr) should be apply_filters('post_gallery', $attr);

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 5 01:31:15 GMT 2008


#8480: apply_filters('post_gallery', '', $attr) should be
apply_filters('post_gallery', $attr);
-----------------------------------------------+----------------------------
 Reporter:  chionsas.org                       |        Owner:         
     Type:  defect                             |       Status:  closed 
 Priority:  normal                             |    Milestone:         
Component:  Gallery                            |      Version:  2.7    
 Severity:  normal                             |   Resolution:  invalid
 Keywords:  gallery, shortcode, apply_filters  |  
-----------------------------------------------+----------------------------
Comment (by DD32):

 It also allows for multiple filters, eg:

 {{{
 add_filter('post_content', 'f1', 10, 2);
 add_filter('post_content', 'f2', 10, 2);

 function f1($content, $attr) { return 'F1' . $content };
 function f2($content, $attr) { return 'F2' . $content };
 }}}
 That would result in 'F1F2' as the gallery, If only $attr was passed, It'd
 be impossible to have multiple filters on it (Which while you may not see
 the need, There are occasions which it could be useful).

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


More information about the wp-trac mailing list