Ticket #24309: gallery-filters.diff
| File gallery-filters.diff, 1.2 KB (added by , 13 years ago) |
|---|
-
wp-includes/media.php
2342 2342 function get_post_galleries( $post_id = 0, $html = true ) { 2343 2343 $post = empty( $post_id ) ? clone get_post() : get_post( $post_id ); 2344 2344 if ( empty( $post ) || ! has_shortcode( $post->post_content, 'gallery' ) ) 2345 return a rray();2345 return apply_filters( 'get_post_galleries', array(), $post_id, $html ); 2346 2346 2347 return get_content_galleries( $post->post_content, $html ); 2347 $galleries = get_content_galleries( $post->post_content, $html ); 2348 return apply_filters( 'get_post_galleries', $galleries, $post_id, $html ); 2348 2349 } 2349 2350 2350 2351 /** … … 2377 2378 function get_post_gallery( $post_id = 0, $html = true ) { 2378 2379 $post = empty( $post_id ) ? clone get_post() : get_post( $post_id ); 2379 2380 if ( empty( $post ) || ! has_shortcode( $post->post_content, 'gallery' ) ) 2380 return a rray();2381 2381 return apply_filters( 'get_post_gallery', array(), $post_id, $html ); 2382 2382 2383 $data = get_content_galleries( $post->post_content, $html, false, 1 ); 2383 return reset( $data ); 2384 $gallery = reset( $data ); 2385 return apply_filters( 'get_post_gallery', $gallery, $post_id, $html ); 2384 2386 } 2385 2387 2386 2388 /**