Make WordPress Core

Ticket #24270: 24270.2.diff

File 24270.2.diff, 828 bytes (added by kovshenin, 13 years ago)
  • wp-includes/media.php

     
    23722372 *
    23732373 * @param int $post_id Optional. Post ID.
    23742374 * @param boolean $html Whether to return HTML or data
    2375  * @return array Gallery data and srcs parsed from the expanded shortcode
     2375 * @return string|array Gallery data and srcs parsed from the expanded shortcode
    23762376 */
    23772377function get_post_gallery( $post_id = 0, $html = true ) {
    23782378        $post = empty( $post_id ) ? clone get_post() : get_post( $post_id );
    23792379        if ( empty( $post ) || ! has_shortcode( $post->post_content, 'gallery' ) )
    2380                 return array();
     2380                return $html ? '' : array();
    23812381
    23822382        $data = get_content_galleries( $post->post_content, $html, false, 1 );
    23832383        return reset( $data );