apply_filters( 'get_post_gallery', array $gallery, int|WP_Post $post, array $galleries )
- Since
- 3.6.0
Filters the first-found post gallery.
Compatibility
- WordPress
- since 3.6.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$galleryarray- The first-found post gallery.
$postint|WP_Post- Post ID or object.
$galleriesarray- Associative array of all found post galleries.
Where this hook fires · 1
wp-includes/media.php:5597get_post_gallery()
Source code
* @since 3.6.0 * * @param array $gallery The first-found post gallery. * @param int|WP_Post $post Post ID or object. * @param array $galleries Associative array of all found post galleries. */ return apply_filters( 'get_post_gallery', $gallery, $post, $galleries );} /** * Retrieves the image srcs from galleries from a post's content, if present. * * @since 3.6.0Changelog
Introduced in 3.6.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.