Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 17320)
+++ wp-includes/post.php	(working copy)
@@ -5009,7 +5009,7 @@
  * @uses wp_find_hierarchy_loop()
  *
  * @param int $post_parent ID of the parent for the post we're checking.
- * @parem int $post_ID ID of the post we're checking.
+ * @param int $post_ID ID of the post we're checking.
  *
  * @return int The new post_parent for the post.
  */
@@ -5235,4 +5235,21 @@
 }
 add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' );
 
-?>
\ No newline at end of file
+/**
+ * Return array of posts for post_type='page' for those pages with the given page template.
+ *
+ * @param string $template Filename of the assigned template for a page.
+ *
+ * @return array The posts that have a template matching the one passed.
+ */
+function get_pages_by_template( $template ) {
+	global $wpdb;
+	$sql = "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='_wp_page_template' AND meta_value LIKE '%s'";
+	$sql = $wpdb->prepare( $sql, $template . '%' );  // '%' to allow partial matches
+	$pages = $wpdb->get_col($sql);
+	foreach( $pages as $index => $page_id )
+		$pages[$page_id] = get_post( $page_id );
+	return apply_filters( 'get_pages_by_template', $pages, $template );
+}
+
+?>
