wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



get_post_gallery_images › WordPress Function

Depuis3.6.0
Dépréciéen/a
get_post_gallery_images ( $post = 0 )
Paramètres:
  • (int|WP_Post) $post Optional. Post ID or WP_Post object. Default is global `$post`.
    Requis: Non
    Défaut:
Voir:
Retourne:
  • (string[]) A list of a gallery's image srcs in order.
Défini(e) dans:
Codex:

Checks a post's content for galleries and return the image srcs for the first found gallery.



Source

function get_post_gallery_images( $post = 0 ) {
	$gallery = get_post_gallery( $post, false );
	return empty( $gallery['src'] ) ? array() : $gallery['src'];
}