get_post_gallery
Filters the first-found post gallery.
Usage
add_filter( 'get_post_gallery', 'wp_kama_get_post_gallery_filter', 10, 3 ); /** * Function for `get_post_gallery` filter-hook. * * @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 array */ function wp_kama_get_post_gallery_filter( $gallery, $post, $galleries ){ // filter... return $gallery; }
- $gallery(array)
- The first-found post gallery.
- $post(int|WP_Post)
- Post ID or object.
- $galleries(array)
- Associative array of all found post galleries.
Changelog
Since 3.6.0 | Introduced. |
Where the hook is called
get_post_gallery
wp-includes/media.php 5239
return apply_filters( 'get_post_gallery', $gallery, $post, $galleries );