Make WordPress Core

Ticket #23843: 23843.2.diff

File 23843.2.diff, 2.2 KB (added by wonderboymusic, 13 years ago)
  • wp-includes/media.php

    diff --git a/wp-includes/media.php b/wp-includes/media.php
    index e63e5bb..894d41c 100644
    a b function wp_audio_shortcode( $attr ) { 
    875875        }
    876876
    877877        if ( ! $primary ) {
    878                 $audios = get_attached_audio( $post_id );
     878                $audios = get_attached_media( 'audio', $post_id );
    879879                if ( empty( $audios ) )
    880880                        return;
    881881
    function wp_video_shortcode( $attr ) { 
    993993        }
    994994
    995995        if ( ! $primary ) {
    996                 $videos = get_attached_video( $post_id );
     996                $videos = get_attached_media( 'video', $post_id );
    997997                if ( empty( $videos ) )
    998998                        return;
    999999
    function get_attached_media( $type, $post_id = 0 ) { 
    18701870}
    18711871
    18721872/**
    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 /**
    18971873 * Extract and parse {media type} shortcodes or srcs from the passed content
    18981874 *
    18991875 * @since 3.6.0
    function the_post_format_audio() { 
    21212097 * @param int $post_id Optional. Post ID.
    21222098 * @return array Found image attachments
    21232099 */
    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  */
    21362100function get_attached_image_srcs( $post_id = 0 ) {
    2137         $children = get_attached_images( $post_id );
     2101        $children = get_attached_media( 'image', $post_id );
    21382102        if ( empty( $children ) )
    21392103                return array();
    21402104
    function get_the_post_format_image( $attached_size = 'full', &$post = null ) { 
    23852349        $matched = false;
    23862350        $link_fmt = '%s';
    23872351
    2388         $medias = get_attached_images( $post->ID );
     2352        $medias = get_attached_media( 'image', $post->ID );
    23892353        if ( ! empty( $medias ) ) {
    23902354                $media = reset( $medias );
    23912355                $sizes = get_intermediate_image_sizes();