On this page
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
$outputstring-
The gallery output. Default empty.
$attrarray-
Attributes of the gallery shortcode.
$instanceint-
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. View all references
$output = apply_filters( 'post_gallery', '', $attr, $instance );
Related
Used By
| Used By | Description |
|---|---|
| gallery_shortcode() wp-includes/media.php | Builds the Gallery shortcode output. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/post_gallery