WordPress at a glance
filter is not described

post_gallery filter-hook . WP 2.5.0

Filters the default gallery shortcode output.

If the filtered output isn't empty, it will be used instead of generating the default gallery template.

Usage

add_filter( 'post_gallery', 'filter_function_name_8103', 10, 3 );
function filter_function_name_8103( $output, $attr, $instance ){
	// filter...

	return $output;
}
$output(string)
The gallery output.
Default: ''
$attr(array)
Attributes of the gallery shortcode.
$instance(int)
Unique numeric ID of this gallery shortcode instance.

Notes

  • Since 4.2.0 The $instance parameter was added.

Where the hook is called

gallery_shortcode()
post_gallery
wp-includes/media.php 1660
$output = apply_filters( 'post_gallery', '', $attr, $instance );

Where the hook is used (in WP core)

Does not used.