get_post_gallery

Advertisement

Summery Summery

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

Syntax Syntax

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

Parameters Parameters

$post

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

$html

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

Default value: true

Return Return

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

Source Source

File: wp-includes/media.php

		'restoreSelected'             => __( 'Restore from Trash' ),
		'deletePermanently'           => __( 'Delete permanently' ),
		'apply'                       => __( 'Apply' ),
		'filterByDate'                => __( 'Filter by date' ),
		'filterByType'                => __( 'Filter by type' ),
		'searchLabel'                 => __( 'Search' ),
		'searchMediaLabel'            => __( 'Search media' ),          // Backward compatibility pre-5.3.
		'searchMediaPlaceholder'      => __( 'Search media items...' ), // Placeholder (no ellipsis), backward compatibility pre-5.3.
		'mediaFound'                  => __( 'Number of media items found: %d' ),
		'mediaFoundHasMoreResults'    => __( 'Number of media items displayed: %d. Scroll the page for more results.' ),
		'noMedia'                     => __( 'No media items found.' ),
		'noMediaTryNewSearch'         => __( 'No media items found. Try a different search.' ),

		// Library Details.
		'attachmentDetails'           => __( 'Attachment details' ),

Advertisement

Changelog Changelog

Changelog
Version Description
3.6.0 Introduced.

Advertisement

Leave a Reply