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
This commit is contained in:
westi 2008-07-30 07:01:03 +00:00
parent 33ad189d78
commit e612643a06
1 changed files with 4 additions and 2 deletions

View File

@ -696,7 +696,8 @@ function next_posts_link($label='Next Page »', $max_page=0) {
if ( (! is_single()) && (empty($paged) || $nextpage <= $max_page) ) { if ( (! is_single()) && (empty($paged) || $nextpage <= $max_page) ) {
echo '<a href="'; echo '<a href="';
next_posts($max_page); next_posts($max_page);
echo '">'. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $label) .'</a>'; $attr = apply_filters( 'next_posts_link_attributes', '' );
echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $label) .'</a>';
} }
} }
@ -720,7 +721,8 @@ function previous_posts_link($label='&laquo; Previous Page') {
if ( (!is_single()) && ($paged > 1) ) { if ( (!is_single()) && ($paged > 1) ) {
echo '<a href="'; echo '<a href="';
previous_posts(); previous_posts();
echo '">'. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $label) .'</a>'; $attr = apply_filters( 'previous_posts_link_attributes', '' );
echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $label) .'</a>';
} }
} }