+
+ /**
+ * Filter the adjacent post link.
+ *
+ * The dynamic portion of the hook name, $adjacent, refers to the type
+ * of adjacency, 'next' or 'previous'.
+ *
+ * @since 2.6.0
+ *
+ * @param string $output The adjacent post link.
+ * @param string $format Link anchor format.
+ * @param string $link Link permalink format.
+ * @param WP_Post $post The adjacent post.
+ */
+ return apply_filters( "{$adjacent}_post_link", $output, $format, $link, $post );
+}
+
+/**
+ * Display adjacent post link.
+ *
+ * Can be either next post link or previous.
+ *
+ * @since 2.5.0
+ * @uses get_adjacent_post_link()
+ *
+ * @param string $format Link anchor format.
+ * @param string $link Link permalink format.
+ * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term.
+ * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded category IDs.
+ * @param bool $previous Optional. Whether to display link to previous or next post. Default true.
+ * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'.
+ * @return string
+ */
+function adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) {
+ echo get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, $previous, $taxonomy );