WordPress.org

Make WordPress Core

Ticket #24270: 24270.3.diff

File 24270.3.diff, 849 bytes (added by wonderboymusic, 5 years ago)
  • wp-includes/media.php

    diff --git a/wp-includes/media.php b/wp-includes/media.php
    index e63e5bb..1693ec8 100644
    a b function get_post_galleries_images( $post_id = 0 ) { 
    23202320 *
    23212321 * @param int $post_id Optional. Post ID.
    23222322 * @param boolean $html Whether to return HTML or data
    2323  * @return array Gallery data and srcs parsed from the expanded shortcode
     2323 * @return string|array Gallery data and srcs parsed from the expanded shortcode
    23242324 */
    23252325function get_post_gallery( $post_id = 0, $html = true ) {
    23262326        if ( ! $post = get_post( $post_id ) )
    2327                 return array();
     2327                return $html ? '' : array();
    23282328
    23292329        if ( ! has_shortcode( $post->post_content, 'gallery' ) )
    2330                 return array();
     2330                return $html ? '' : array();
    23312331
    23322332        $data = get_content_galleries( $post->post_content, $html, false, 1 );
    23332333        return reset( $data );