From 5da392a62f42e32ab00b8ab5ab41d24989fbbc6b Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Fri, 5 Jul 2013 20:41:49 +0000 Subject: [PATCH] Drop some wrapper functions * `get_attached_audio()` (use `get_attached_media( 'audio' )`) * `get_attached_images()` (use `get_attached_media( 'image' )`) * `get_attached_videos()` (use `get_attached_media( 'video' )`) props wonderboymusic. fixes #23843. git-svn-id: http://core.svn.wordpress.org/trunk@24571 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 42 +++--------------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 50394fc696..9ea02fe15c 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -881,7 +881,7 @@ function wp_audio_shortcode( $attr ) { } if ( ! $primary ) { - $audios = get_attached_audio( $post_id ); + $audios = get_attached_media( 'audio', $post_id ); if ( empty( $audios ) ) return; @@ -999,7 +999,7 @@ function wp_video_shortcode( $attr ) { } if ( ! $primary ) { - $videos = get_attached_video( $post_id ); + $videos = get_attached_media( 'video', $post_id ); if ( empty( $videos ) ) return; @@ -1865,30 +1865,6 @@ function get_attached_media( $type, $post_id = 0 ) { return (array) apply_filters( 'get_attached_media', $children, $type, $post ); } -/** - * Retrieve audio attached to the passed post - * - * @since 3.6.0 - * - * @param int $post_id Post ID - * @return array Found audio attachments - */ -function get_attached_audio( $post_id = 0 ) { - return get_attached_media( 'audio', $post_id ); -} - -/** - * Retrieve video attached to the passed post - * - * @since 3.6.0 - * - * @param int $post_id Post ID - * @return array Found video attachments - */ -function get_attached_video( $post_id = 0 ) { - return get_attached_media( 'video', $post_id ); -} - /** * Extract and parse {media type} shortcodes or srcs from the passed content * @@ -2022,18 +1998,6 @@ function get_embedded_video( $content ) { return get_embedded_media( 'video', $content ); } -/** - * Retrieve images attached to the passed post - * - * @since 3.6.0 - * - * @param int $post_id Optional. Post ID. - * @return array Found image attachments - */ -function get_attached_images( $post_id = 0 ) { - return get_attached_media( 'image', $post_id ); -} - /** * Retrieve images attached to the passed post * @@ -2043,7 +2007,7 @@ function get_attached_images( $post_id = 0 ) { * @return array Found image attachments */ function get_attached_image_srcs( $post_id = 0 ) { - $children = get_attached_images( $post_id ); + $children = get_attached_media( 'image', $post_id ); if ( empty( $children ) ) return array();