Core Function
View Source on Trac ↗ get_post_gallery()
get_post_gallery( mixed $post = 0, mixed $html = true ) Checks a specified post's content for gallery and, if present, return the first
Parameters 1 required
| Name / Type | Description |
|---|---|
| (int | | WP_Post) $post Optional. Post ID or WP_Post object. Default is global $post. Required |
| $html bool | Optional. Whether to return HTML or data. Default is true. |
Return Value
((string)
| array) Gallery data and srcs parsed from the expanded shortcode.
Function Information
Since Version
3.6.0
Source File
wp-includes/media.php
Advertisement