[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
Thu Dec 4 01:19:55 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 |
-----------------------------------------------+----------------------------
Changes (by DD32):
* status: new => closed
* resolution: => invalid
* milestone: 2.7 =>
Comment:
The filter is correct.
Apply_filters() can accept multiple params, You need to use add filters
like this:
{{{
add_filters('post_gallery', 'my_gallery', 10, 2);
}}}
(10 = default priority, 2 = accept 2 parameters)
the function should be as such:
{{{
function my_gallery($gallery_html, $attrs) {
return $gallery_html
}
}}}
--
Ticket URL: <http://trac.wordpress.org/ticket/8480#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list