diff --git a/wp-includes/media.php b/wp-includes/media.php
index e63e5bb..894d41c 100644
|
a
|
b
|
function wp_audio_shortcode( $attr ) { |
| 875 | 875 | } |
| 876 | 876 | |
| 877 | 877 | if ( ! $primary ) { |
| 878 | | $audios = get_attached_audio( $post_id ); |
| | 878 | $audios = get_attached_media( 'audio', $post_id ); |
| 879 | 879 | if ( empty( $audios ) ) |
| 880 | 880 | return; |
| 881 | 881 | |
| … |
… |
function wp_video_shortcode( $attr ) { |
| 993 | 993 | } |
| 994 | 994 | |
| 995 | 995 | if ( ! $primary ) { |
| 996 | | $videos = get_attached_video( $post_id ); |
| | 996 | $videos = get_attached_media( 'video', $post_id ); |
| 997 | 997 | if ( empty( $videos ) ) |
| 998 | 998 | return; |
| 999 | 999 | |
| … |
… |
function get_attached_media( $type, $post_id = 0 ) { |
| 1870 | 1870 | } |
| 1871 | 1871 | |
| 1872 | 1872 | /** |
| 1873 | | * Retrieve audio attached to the passed post |
| 1874 | | * |
| 1875 | | * @since 3.6.0 |
| 1876 | | * |
| 1877 | | * @param int $post_id Post ID |
| 1878 | | * @return array Found audio attachments |
| 1879 | | */ |
| 1880 | | function get_attached_audio( $post_id = 0 ) { |
| 1881 | | return get_attached_media( 'audio', $post_id ); |
| 1882 | | } |
| 1883 | | |
| 1884 | | /** |
| 1885 | | * Retrieve video attached to the passed post |
| 1886 | | * |
| 1887 | | * @since 3.6.0 |
| 1888 | | * |
| 1889 | | * @param int $post_id Post ID |
| 1890 | | * @return array Found video attachments |
| 1891 | | */ |
| 1892 | | function get_attached_video( $post_id = 0 ) { |
| 1893 | | return get_attached_media( 'video', $post_id ); |
| 1894 | | } |
| 1895 | | |
| 1896 | | /** |
| 1897 | 1873 | * Extract and parse {media type} shortcodes or srcs from the passed content |
| 1898 | 1874 | * |
| 1899 | 1875 | * @since 3.6.0 |
| … |
… |
function the_post_format_audio() { |
| 2121 | 2097 | * @param int $post_id Optional. Post ID. |
| 2122 | 2098 | * @return array Found image attachments |
| 2123 | 2099 | */ |
| 2124 | | function get_attached_images( $post_id = 0 ) { |
| 2125 | | return get_attached_media( 'image', $post_id ); |
| 2126 | | } |
| 2127 | | |
| 2128 | | /** |
| 2129 | | * Retrieve images attached to the passed post |
| 2130 | | * |
| 2131 | | * @since 3.6.0 |
| 2132 | | * |
| 2133 | | * @param int $post_id Optional. Post ID. |
| 2134 | | * @return array Found image attachments |
| 2135 | | */ |
| 2136 | 2100 | function get_attached_image_srcs( $post_id = 0 ) { |
| 2137 | | $children = get_attached_images( $post_id ); |
| | 2101 | $children = get_attached_media( 'image', $post_id ); |
| 2138 | 2102 | if ( empty( $children ) ) |
| 2139 | 2103 | return array(); |
| 2140 | 2104 | |
| … |
… |
function get_the_post_format_image( $attached_size = 'full', &$post = null ) { |
| 2385 | 2349 | $matched = false; |
| 2386 | 2350 | $link_fmt = '%s'; |
| 2387 | 2351 | |
| 2388 | | $medias = get_attached_images( $post->ID ); |
| | 2352 | $medias = get_attached_media( 'image', $post->ID ); |
| 2389 | 2353 | if ( ! empty( $medias ) ) { |
| 2390 | 2354 | $media = reset( $medias ); |
| 2391 | 2355 | $sizes = get_intermediate_image_sizes(); |