Index: theme.php
===================================================================
--- theme.php	(revision 18519)
+++ theme.php	(working copy)
@@ -1060,7 +1060,7 @@
 }
 
 /**
- * Retrieve the name of the highest priority template file that exists.
+ * Retrieve the full file path to the highest priority template file that exists.
  *
  * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
  * inherit from a parent theme can just overload one file.
@@ -1093,6 +1093,34 @@
 }
 
 /**
+ * Retrieve the URI 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.3
+ *
+ * @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 locate_template_uri( $template_names ) {
+	$located = '';
+	foreach ( (array) $template_names as $template_name ) {
+		if ( !$template_name )
+			continue;
+		if ( file_exists(get_stylesheet_directory() . '/' . $template_name)) {
+			$located = get_stylesheet_directory_uri() . '/' . $template_name;
+			break;
+		} else if ( file_exists(get_template_directory() . '/' . $template_name) ) {
+			$located = get_template_directory_uri() . '/' . $template_name;
+			break;
+		}
+	}
+
+	return $located;
+}
+
+/**
  * Require the template file with WordPress environment.
  *
  * The globals are set up for the template file to ensure that the WordPress
