Index: link-template.php
===================================================================
--- link-template.php	(revision 10187)
+++ link-template.php	(working copy)
@@ -970,6 +970,86 @@
 }
 
 /**
+ * Display adjacent post relational link.
+ *
+ * Can either be next or previous post relational link.
+ *
+ * @since 2.8.0
+ *
+ * @param string $title Optional. Link title format.
+ * @param bool $in_same_cat Optional. Whether link should be in same category.
+ * @param string $excluded_categories Optional. Excluded categories IDs.
+ * @param bool $previous Optional, default is true. Whether display link to previous post.
+ */
+//function get_adjacent_post_rel_link($prev = true, $next = true) {
+function adjacent_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $previous = true) {
+	if ( $previous && is_attachment() )
+		$post = & get_post($GLOBALS['post']->post_parent);
+	else
+		$post = get_adjacent_post($in_same_cat,$excluded_categories,$previous);
+
+	if ( !$post )
+		return;
+
+	if ( empty($post->post_title) )
+		$post->post_title = $previous ? __('Previous Post') : __('Next Post');
+
+	$date = mysql2date(get_option('date_format'), $post->post_date);
+
+	$title = str_replace('%title', $post->post_title, $title);
+	$title = str_replace('%date', $date, $title);
+
+	$title = apply_filters('the_title', $title, $post);
+	
+	$link .= $previous ? "<link rel='prev' title='" : "<link rel='next' title='";
+	$link .= $title;
+	$link .= "' href='" . get_permalink($post) . "' />\n";
+
+        $adjacent = $previous ? 'previous' : 'next';
+        echo apply_filters( "{$adjacent}_post_rel_link", $link );
+}
+
+/**
+ * Display relational links for the posts adjacent to the current post.
+ *
+ * @since 2.8.0
+ *
+ * @param string $title Optional. Link title format.
+ * @param bool $in_same_cat Optional. Whether link should be in same category.
+ * @param string $excluded_categories Optional. Excluded categories IDs.
+ */
+function adjacent_posts_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') {
+	adjacent_post_rel_link($title, $in_same_cat, $excluded_categories = '', true);
+	adjacent_post_rel_link($title, $in_same_cat, $excluded_categories = '', false);
+}
+
+/**
+ * Display relational link for the next post adjacent to the current post.
+ *
+ * @since 2.8.0
+ *
+ * @param string $title Optional. Link title format.
+ * @param bool $in_same_cat Optional. Whether link should be in same category.
+ * @param string $excluded_categories Optional. Excluded categories IDs.
+ */
+function next_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') {
+	adjacent_post_rel_link($title, $in_same_cat, $excluded_categories = '', false);
+}
+
+/**
+ * Display relational link for the previous post adjacent to the current post.
+ *
+ * @since 2.8.0
+ *
+ * @param string $title Optional. Link title format.
+ * @param bool $in_same_cat Optional. Whether link should be in same category.
+ * @param string $excluded_categories Optional. Excluded categories IDs.
+ */
+function prev_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '') {
+	adjacent_post_rel_link($title, $in_same_cat, $excluded_categories = '', true);
+}
+
+/**
  * Retrieve get links for page numbers.
  *
  * @since 1.5.0
