apply_filters('post_gallery', '', $attr) should be apply_filters('post_gallery', $attr);
|Reported by:||chionsas.org||Owned by:|
|Component:||Gallery||Keywords:||gallery, shortcode, apply_filters|
When customizing the gallery shortcode functionality via 'post_gallery' filter,
the filter function does not receive [gallery] shorttag inline arguments (eg. [shorttag columns="5"])
This seems to be bacause of bogus parameters, sent to apply_filters() funcion on
Correct syntax, according to http://codex.wordpress.org/Function_Reference/apply_filters is:
When that 601 line in wp-includes/media.php is changed to:
$output = apply_filters('post_gallery', $attr);
(that is, the second argument is removed), everything works as expected.
It seems that the bug was made because of add_filter() funcion syntax that takes three parameters - tag, priority and argument count. This would explain the empty second argument.
I don't consider this bug to be urgent, but as the fix is extremely simple, it could surely make the 2.7 final :)
This affects 2.7RC1, 2.6x and (I beleive) all the way down to when gallery functionality was introduced.
Change History (7)
- Milestone 2.7 deleted
- Resolution set to invalid
- Status changed from new to closed