Changeset 24249 for trunk/wp-includes/media.php
- Timestamp:
- 05/14/2013 01:57:59 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r24241 r24249 1851 1851 */ 1852 1852 function get_attached_media( $type, $post_id = 0 ) { 1853 $post = empty( $post_id ) ? get_post() : get_post( $post_id ); 1854 if ( empty( $post ) ) 1853 if ( ! $post = get_post( $post_id ) ) 1855 1854 return; 1856 1855 … … 2341 2340 */ 2342 2341 function get_post_galleries( $post_id = 0, $html = true ) { 2343 $post = empty( $post_id ) ? clone get_post() : get_post( $post_id ); 2344 if ( empty( $post ) || ! has_shortcode( $post->post_content, 'gallery' ) ) 2342 if ( ! $post = get_post( $post_id ) ) 2343 return array(); 2344 2345 if ( ! has_shortcode( $post->post_content, 'gallery' ) ) 2345 2346 return array(); 2346 2347 … … 2358 2359 */ 2359 2360 function get_post_galleries_images( $post_id = 0 ) { 2360 $post = empty( $post_id ) ? clone get_post() : get_post( $post_id ); 2361 if ( empty( $post ) || ! has_shortcode( $post->post_content, 'gallery' ) ) 2361 if ( ! $post = get_post( $post_id ) ) 2362 return array(); 2363 2364 if ( ! has_shortcode( $post->post_content, 'gallery' ) ) 2362 2365 return array(); 2363 2366 … … 2376 2379 */ 2377 2380 function get_post_gallery( $post_id = 0, $html = true ) { 2378 $post = empty( $post_id ) ? clone get_post() : get_post( $post_id ); 2379 if ( empty( $post ) || ! has_shortcode( $post->post_content, 'gallery' ) ) 2381 if ( ! $post = get_post( $post_id ) ) 2382 return array(); 2383 2384 if ( ! has_shortcode( $post->post_content, 'gallery' ) ) 2380 2385 return array(); 2381 2386
Note: See TracChangeset
for help on using the changeset viewer.