post_gallery WordPress Filter Hook
This hook is used to insert a gallery of images into a post.
apply_filters( 'post_gallery', string $output , array $attr , int $instance ) #
Filters the default gallery shortcode output.
Description
If the filtered output isn’t empty, it will be used instead of generating the default gallery template.
See also
Parameters
- $output
(string)The gallery output. Default empty.
- $attr
(array)Attributes of the gallery shortcode.
- $instance
(int)Unique numeric ID of this gallery shortcode instance.
More Information
This filter allows plugins and themes to override the default gallery template (i.e. what the gallery shortcode returns).
Source
File: wp-includes/media.php
Changelog
Version | Description |
---|---|
4.2.0 | The $instance parameter was added. |
2.5.0 | Introduced. |