From e612643a069f4bc6685db4232ce42a6272524d1e Mon Sep 17 00:00:00 2001 From: westi Date: Wed, 30 Jul 2008 07:01:03 +0000 Subject: [PATCH] Allow a plugin to add attributes to the next and previous posts links. Fixes #7434 props JohnLamansky. git-svn-id: http://svn.automattic.com/wordpress/trunk@8502 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index f27fbe551..ea4b07b0e 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -696,7 +696,8 @@ function next_posts_link($label='Next Page »', $max_page=0) { if ( (! is_single()) && (empty($paged) || $nextpage <= $max_page) ) { echo ''. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .''; + $attr = apply_filters( 'next_posts_link_attributes', '' ); + echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .''; } } @@ -720,7 +721,8 @@ function previous_posts_link($label='« Previous Page') { if ( (!is_single()) && ($paged > 1) ) { echo ''. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .''; + $attr = apply_filters( 'previous_posts_link_attributes', '' ); + echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .''; } }