Ticket #24270: 24270.2.diff
| File 24270.2.diff, 828 bytes (added by , 13 years ago) |
|---|
-
wp-includes/media.php
2372 2372 * 2373 2373 * @param int $post_id Optional. Post ID. 2374 2374 * @param boolean $html Whether to return HTML or data 2375 * @return array Gallery data and srcs parsed from the expanded shortcode2375 * @return string|array Gallery data and srcs parsed from the expanded shortcode 2376 2376 */ 2377 2377 function get_post_gallery( $post_id = 0, $html = true ) { 2378 2378 $post = empty( $post_id ) ? clone get_post() : get_post( $post_id ); 2379 2379 if ( empty( $post ) || ! has_shortcode( $post->post_content, 'gallery' ) ) 2380 return array();2380 return $html ? '' : array(); 2381 2381 2382 2382 $data = get_content_galleries( $post->post_content, $html, false, 1 ); 2383 2383 return reset( $data );