get_post_gallery

SummerySummery

Check a specified post’s content for gallery and, if present, return the first

Syntax

get_post_gallery( int|WP_Post $post, bool $html = true )

ParametersParameters

$post

(int|WP_Post) (Optional) Post ID or WP_Post object. Default is global $post.

$html

(bool) (Optional) Whether to return HTML or data. Default is true.

Default value: true

ReturnReturn

(string|array) Gallery data and srcs parsed from the expanded shortcode.

SourceSource

File: wp-includes/media.php


			

ChangelogChangelog

Changelog
Version Description
3.6.0 Introduced.
Scroll to Top