Index: wp-includes/post-template.php
===================================================================
--- wp-includes/post-template.php	(revision 15292)
+++ wp-includes/post-template.php	(working copy)
@@ -92,6 +92,33 @@
 }
 
 /**
+ * Retrieve the post ID from its name or slug.
+ *
+ * @since 3.1.0
+ *
+ * @param string $slug The name or slug of the post to retrieve.
+ * @return int The ID of the retrieved post, or 0 if none found.
+ */
+function get_id_by_name( $slug = '' ) {
+	if ( empty( $slug ) )
+		return 0;
+	$query = new WP_Query;
+	$posts = (array) $query->query( array(
+		'name' => $slug,
+		'post_status' => 'publish',
+		'post_type' => 'any',
+		'showposts' => 1,
+	) );
+	
+	$post = array_shift( $posts );
+
+	if ( ! empty( $post->ID ) ) 
+		return (int) $post->ID;
+	else
+		return 0;
+}
+
+/**
  * Retrieve post title.
  *
  * If the post is protected and the visitor is not an admin, then "Protected"
