[wp-trac] [WordPress Trac] #29832: Add filter to final output of gallery_shortcode

WordPress Trac noreply at wordpress.org
Fri Mar 18 04:04:11 UTC 2016


#29832: Add filter to final output of gallery_shortcode
-------------------------+-----------------------
 Reporter:  dcrabill     |       Owner:
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  Gallery      |     Version:  2.5
 Severity:  normal       |  Resolution:  wontfix
 Keywords:               |     Focuses:  template
-------------------------+-----------------------

Comment (by gnotaras):

 Replying to [comment:1 SergeyBiryukov]:
 > {{{
 > function filter_gallery_shortcode_output_29832( $gallery, $attr ) {
 >       remove_filter( 'post_gallery', __FUNCTION__, 10, 2 );
 >
 >       $gallery = gallery_shortcode( $attr );
 >
 >       add_filter( 'post_gallery', __FUNCTION__, 10, 2 );
 >
 >       // Change the output
 >       // $gallery = ...
 >
 >       return $gallery;
 > }
 > add_filter( 'post_gallery', 'filter_gallery_shortcode_output_29832', 10,
 2 );
 > }}}

 @SergeyBiryukov that was a nice workaround for #36270 !

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29832#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list