Index: wp-content/themes/twentyeleven/functions.php
===================================================================
--- wp-content/themes/twentyeleven/functions.php	(revision 24580)
+++ wp-content/themes/twentyeleven/functions.php	(working copy)
@@ -644,7 +644,11 @@
 	$images = array();
 
 	if ( function_exists( 'get_post_galleries' ) ) {
-		$galleries = get_post_galleries( get_the_ID(), false );
+		$galleries = get_post_galleries( array(
+			'post_id' => get_the_ID(),
+			'html'    => false
+		) );
+
 		if ( isset( $galleries[0]['ids'] ) )
 		 	$images = explode( ',', $galleries[0]['ids'] );
 	} else {
Index: wp-content/themes/twentyten/functions.php
===================================================================
--- wp-content/themes/twentyten/functions.php	(revision 24580)
+++ wp-content/themes/twentyten/functions.php	(working copy)
@@ -529,7 +529,11 @@
 	$images = array();
 
 	if ( function_exists( 'get_post_galleries' ) ) {
-		$galleries = get_post_galleries( get_the_ID(), false );
+		$galleries = get_post_galleries( array(
+			'post_id' => get_the_ID(),
+			'html'    => false
+		) );
+
 		if ( isset( $galleries[0]['ids'] ) )
 		 	$images = explode( ',', $galleries[0]['ids'] );
 	} else {
Index: wp-includes/media.php
===================================================================
--- wp-includes/media.php	(revision 24580)
+++ wp-includes/media.php	(working copy)
@@ -1868,30 +1868,44 @@
 /**
  * Extract and parse {media type} shortcodes or srcs from the passed content
  *
+ * $args contents:
+ * - type   - Type of media: audio or video.
+ * - return - Whether to return HTML or URLs.
+ * - limit  - The number of medias to return.
+ *
  * @since 3.6.0
  *
- * @param string $type Type of media: audio or video
  * @param string $content A string which might contain media data.
- * @param boolean $html Whether to return HTML or URLs
- * @param int $limit Optional. The number of medias to return
+ * @param array $args An array of arguments.
  * @return array A list of parsed shortcodes or extracted srcs
  */
-function get_content_media( $type, $content, $html = true, $limit = 0 ) {
+function get_content_media( $content, $args ) {
+	$defaults = array(
+		'type'  => null,
+		'html'  => true,
+		'limit' => 0
+	);
+
+	$args = wp_parse_args( $args, $defaults );
+
+	if ( empty( $args['type'] ) )
+		return;
+
 	$items = array();
 
 	if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) {
 		foreach ( $matches as $shortcode ) {
-			if ( $type === $shortcode[2] ) {
+			if ( $args['type'] === $shortcode[2] ) {
 				$count = 1;
 
 				$items[] = do_shortcode_tag( $shortcode );
-				if ( $limit > 0 && count( $items ) >= $limit )
+				if ( $args['limit'] > 0 && count( $items ) >= $args['limit'] )
 					break;
 			}
 		}
 	}
 
-	if ( $html )
+	if ( $args['html'] )
 		return $items;
 
 	$data = array();
@@ -1914,26 +1928,39 @@
  * Check the content blob for an <{media type}>, <object>, <embed>, or <iframe>, in that order
  * If no HTML tag is found, check the first line of the post for a URL
  *
+ * $args contents:
+ * - type  - Type of media: audio or video.
+ * - limit - The number of medias to return.
+ *
  * @since 3.6.0
  *
- * @param string $type Type of media: audio or video
  * @param string $content A string which might contain media data.
- * @param int $limit Optional. The number of galleries to return
+ * @param array $args An array of arguments.
  * @return array A list of found HTML media embeds and possibly a URL by itself
  */
-function get_embedded_media( $type, $content, $limit = 0 ) {
+function get_embedded_media( $content, $args ) {
+	$defaults = array(
+		'type'  => null,
+		'limit' => 0
+	);
+
+	$args = wp_parse_args( $args, $defaults );
+
+	if ( empty( $args['type'] ) )
+		return;
+
 	$html = array();
 
-	foreach ( array( $type, 'object', 'embed', 'iframe' ) as $tag ) {
+	foreach ( array( $args['type'], 'object', 'embed', 'iframe' ) as $tag ) {
 		if ( preg_match( '#' . get_tag_regex( $tag ) . '#', $content, $matches ) ) {
 			$html[] = $matches[0];
 
-			if ( $limit > 0 && count( $html ) >= $limit )
+			if ( $args['limit'] > 0 && count( $html ) >= $args['limit'] )
 				break;
 		}
 	}
 
-	if ( ! empty( $html ) && count( $html ) >= $limit )
+	if ( ! empty( $html ) && count( $html ) >= $args['limit'] )
 		return $html;
 
 	$lines = explode( "\n", trim( $content ) );
@@ -1949,13 +1976,15 @@
  *
  * @since 3.6.0
  *
+ * @uses get_content_media()
+ *
  * @param string $content A string which might contain audio data.
- * @param boolean $html Whether to return HTML or URLs
+ * @param array $args (optional) An array of arguments.
  * @return array A list of lists. Each item has a list of HTML or srcs corresponding
  *		to an [audio]'s HTML or primary src and specified fallbacks
  */
-function get_content_audio( $content, $html = true ) {
-	return get_content_media( 'audio', $content, $html );
+function get_content_audio( $content, $args = array() ) {
+	return get_content_media( $content, array_merge( $args, array( 'type' => 'audio' ) ) );
 }
 
 /**
@@ -1964,11 +1993,14 @@
  *
  * @since 3.6.0
  *
+ * @uses get_embedded_media()
+ *
  * @param string $content A string which might contain audio data.
+ * @param array $args (optional) An array of arguments.
  * @return array A list of found HTML audio embeds and possibly a URL by itself
  */
-function get_embedded_audio( $content ) {
-	return get_embedded_media( 'audio', $content );
+function get_embedded_audio( $content, $args = array() ) {
+	return get_embedded_media( $content, array_merge( $args, array( 'type' => 'audio' ) ) );
 }
 
 /**
@@ -1976,13 +2008,15 @@
  *
  * @since 3.6.0
  *
+ * @uses get_content_media()
+ *
  * @param string $content A string which might contain video data.
- * @param boolean $html Whether to return HTML or URLs
+ * @param array $args (optional) An array of arguments.
  * @return array A list of lists. Each item has a list of HTML or srcs corresponding
  *		to a [video]'s HTML or primary src and specified fallbacks
  */
-function get_content_video( $content, $html = true ) {
-	return get_content_media( 'video', $content, $html );
+function get_content_video( $content, $args = array() ) {
+	return get_content_media( $content, array_merge( $args, array( 'type' => 'video' ) ) );
 }
 
 /**
@@ -1991,11 +2025,14 @@
  *
  * @since 3.6.0
  *
+ * @uses get_embedded_media()
+ *
  * @param string $content A string which might contain video data.
+ * @param array $args (optional) An array of arguments.
  * @return array A list of found HTML video embeds and possibly a URL by itself
  */
-function get_embedded_video( $content ) {
-	return get_embedded_media( 'video', $content );
+function get_embedded_video( $content, $args = array() ) {
+	return get_embedded_media( $content, array_merge( $args, array( 'type' => 'video' ) ) );
 }
 
 /**
@@ -2021,14 +2058,24 @@
 /**
  * Check the content blob for images or image srcs
  *
+ * $args contents:
+ * - html  - Whether to return HTML or URLs.
+ * - limit - The number of images to return.
+ *
  * @since 3.6.0
  *
  * @param string $content A string which might contain image data.
- * @param boolean $html Whether to return HTML or URLs in the array
- * @param int $limit Optional. The number of image srcs to return
+ * @param array $args An array of arguments.
  * @return array The found images or srcs
  */
-function get_content_images( $content, $html = true, $limit = 0 ) {
+function get_content_images( $content, $args ) {
+	$defaults = array(
+		'html'  => true,
+		'limit' => 0
+	);
+
+	$args = wp_parse_args( $args, $defaults );
+
 	$tags = array();
 	$captions = array();
 
@@ -2036,11 +2083,11 @@
 		foreach ( $matches as $shortcode ) {
 			if ( 'caption' === $shortcode[2] ) {
 				$captions[] = $shortcode[0];
-				if ( $html )
+				if ( $args['html'] )
 					$tags[] = do_shortcode_tag( $shortcode );
 			}
 
-			if ( $limit > 0 && count( $tags ) >= $limit )
+			if ( $args['limit'] > 0 && count( $tags ) >= $args['limit'] )
 				break;
 		}
 	}
@@ -2063,13 +2110,13 @@
 				if ( ! $found )
 					$tags[] = $node[0];
 
-				if ( $limit > 0 && count( $tags ) >= $limit )
+				if ( $args['limit'] > 0 && count( $tags ) >= $args['limit'] )
 					break 2;
 			}
 		}
 	}
 
-	if ( $html )
+	if ( $args['html'] )
 		return $tags;
 
 	$srcs = array();
@@ -2078,7 +2125,7 @@
 		preg_match( '#src=([\'"])(.+?)\1#is', $tag, $src );
 		if ( ! empty( $src[2] ) ) {
 			$srcs[] = $src[2];
-			if ( $limit > 0 && count( $srcs ) >= $limit )
+			if ( $args['limit'] > 0 && count( $srcs ) >= $args['limit'] )
 				break;
 		}
 	}
@@ -2092,11 +2139,11 @@
  * @since 3.6.0
  *
  * @param string $content A string which might contain image data.
- * @param boolean $html Whether to return HTML or URLs
+ * @param array $args (optional) An array of arguments.
  * @return string The found data
  */
-function get_content_image( $content, $html = true ) {
-	$srcs = get_content_images( $content, $html, 1 );
+function get_content_image( $content, $args = array() ) {
+	$srcs = get_content_images( $content, array_merge( $args, array( 'limit' => 1 ) ) );
 	if ( empty( $srcs ) )
 		return '';
 
@@ -2106,14 +2153,24 @@
 /**
  * Check the content blob for galleries and return their image srcs
  *
+ * $args contents:
+ * - html  - Whether to return HTML or URLs.
+ * - limit - The number of galleries to return.
+ *
  * @since 3.6.0
  *
  * @param string $content A string which might contain image data.
- * @param boolean $html Whether to return HTML or data in the array
- * @param int $limit Optional. The number of galleries to return
+ * @param array $args (optional) An array of arguments.
  * @return array A list of galleries, which in turn are a list of their srcs in order
  */
-function get_content_galleries( $content, $html = true, $limit = 0 ) {
+function get_content_galleries( $content, $args = array() ) {
+	$defaults = array(
+		'html'  => true,
+		'limit' => 0
+	);
+
+	$args = wp_parse_args( $args, $defaults );
+
 	$galleries = array();
 
 	if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) {
@@ -2124,7 +2181,7 @@
 
 				$data = shortcode_parse_atts( $shortcode[3] );
 				$gallery = do_shortcode_tag( $shortcode );
-				if ( $html ) {
+				if ( $args['html'] ) {
 					$galleries[] = $gallery;
 				} else {
 					preg_match_all( '#src=([\'"])(.+?)\1#is', $gallery, $src, PREG_SET_ORDER );
@@ -2137,7 +2194,7 @@
 					$galleries[] = $data;
 				}
 
-				if ( $limit > 0 && count( $galleries ) >= $limit )
+				if ( $args['limit'] > 0 && count( $galleries ) >= $args['limit'] )
 					break;
 			}
 		}
@@ -2149,21 +2206,33 @@
 /**
  * Retrieve galleries from the passed post's content
  *
+ * $args contents:
+ * - post_id - The post id.
+ * - html    - Whether to return HTML or data.
+ *
  * @since 3.6.0
  *
- * @param int $post_id Optional. Post ID.
- * @param boolean $html Whether to return HTML or data in the array
+ * @uses get_content_galleries()
+ *
+ * @param array $args (optional) An array of arguments.
  * @return array A list of arrays, each containing gallery data and srcs parsed
  *		from the expanded shortcode
  */
-function get_post_galleries( $post_id = 0, $html = true ) {
-	if ( ! $post = get_post( $post_id ) )
+function get_post_galleries( $args = array() ) {
+	$defaults = array(
+		'post_id' => 0,
+		'html'    => true
+	);
+
+	$args = wp_parse_args( $args, $defaults );
+
+	if ( ! $post = get_post( $args['post_id'] ) )
 		return array();
 
 	if ( ! has_shortcode( $post->post_content, 'gallery' )  )
 		return array();
 
-	return get_content_galleries( $post->post_content, $html );
+	return get_content_galleries( $post->post_content, array( 'html' => $args['html'] ) );
 }
 
 /**
@@ -2171,6 +2240,8 @@
  *
  * @since 3.6.0
  *
+ * @uses get_content_galleries()
+ *
  * @param int $post_id Optional. Post ID.
  * @return array A list of lists, each containing image srcs parsed
  *		from an expanded shortcode
@@ -2182,27 +2253,43 @@
 	if ( ! has_shortcode( $post->post_content, 'gallery' )  )
 		return array();
 
-	$data = get_content_galleries( $post->post_content, false );
+	$data = get_content_galleries( $post->post_content, array( 'html' => false ) );
 	return wp_list_pluck( $data, 'src' );
 }
 
 /**
  * Check a specified post's content for gallery and, if present, return the first
  *
+ * $args contents:
+ * - post_id - The post id.
+ * - html    - Whether to return HTML or URLs.
+ *
  * @since 3.6.0
  *
- * @param int $post_id Optional. Post ID.
- * @param boolean $html Whether to return HTML or data
+ * @uses get_content_galleries()
+ *
+ * @param array $args (optional) An array of arguments.
  * @return string|array Gallery data and srcs parsed from the expanded shortcode
  */
-function get_post_gallery( $post_id = 0, $html = true ) {
-	if ( ! $post = get_post( $post_id ) )
+function get_post_gallery( $args = array() ) {
+	$defaults = array(
+		'post_id' => 0,
+		'html'    => true
+	);
+
+	$args = wp_parse_args( $args, $defaults );
+
+	if ( ! $post = get_post( $args['post_id'] ) )
 		return $html ? '' : array();
 
 	if ( ! has_shortcode( $post->post_content, 'gallery' ) )
 		return $html ? '' : array();
 
-	$data = get_content_galleries( $post->post_content, $html, false, 1 );
+	$data = get_content_galleries( $post->post_content, array(
+		'html'  => $args['html'],
+		'limit' => 1
+	) );
+
 	return reset( $data );
 }
 
@@ -2215,7 +2302,11 @@
  * @return array A list of a gallery's image srcs in order
  */
 function get_post_gallery_images( $post_id = 0 ) {
-	$gallery = get_post_gallery( $post_id, false );
+	$gallery = get_post_gallery( array(
+		'post_id' => $post_id,
+		'html'    => false
+	) );
+
 	if ( empty( $gallery['src'] ) )
 		return array();
 
