Index: wp-includes/link-template.php
===================================================================
--- wp-includes/link-template.php	(revision 21271)
+++ wp-includes/link-template.php	(working copy)
@@ -2061,6 +2061,41 @@
 }
 
 /**
+ * Retrieve the url of the highest priority template file that exists.
+ *
+ * Searches in the stylesheet directory before the template directory so themes
+ * which inherit from a parent theme can just overload one file.
+ *
+ * @since 3.5
+ *
+ * @param string|array $template_names Template file(s) to search for, in order.
+ * @return string The URI of the file if one is located.
+ */
+function theme_url( $template_names, $else = null ) {
+	$url = $else;
+	$stylesheet_directory = trailingslashit( get_stylesheet_directory() );
+	$template_directory = trailingslashit( get_template_directory() );
+	$is_child_theme = ( $stylesheet_directory !== $template_directory );
+
+	foreach ( (array) $template_names as $template_name ) {
+		if ( ! $template_name = ltrim( $template_name, '/' ) )
+			continue;
+		if ( $is_child_theme && file_exists( $stylesheet_directory . $template_name ) ) {
+			$url = trailingslashit( get_stylesheet_directory_uri() ) . $template_name;
+			break;
+		} elseif ( file_exists( $template_directory . $template_name ) ) {
+			$url = trailingslashit( get_template_directory_uri() ) . $template_name;
+			break;
+		}
+	}
+
+	if( empty( $url ) && ! empty( $template_name ) )
+		$url = trailingslashit( get_template_directory_uri() ) . $template_name;
+
+	return apply_filters( 'theme_url', $url, $template_names, $else );
+}
+
+/**
  * Retrieve the site url for the current network.
  *
  * Returns the site url with the appropriate protocol, 'https' if
