In `wp_link_pages()`, only output link separators between actual pagination links. Fixes #24940. Props obenland.

Built from https://develop.svn.wordpress.org/trunk@30030


git-svn-id: http://core.svn.wordpress.org/trunk@30030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2014-10-26 22:41:18 +00:00
parent aa469e2623
commit 524097970a
2 changed files with 10 additions and 6 deletions

View File

@ -787,7 +787,10 @@ function wp_link_pages( $args = '' ) {
* @param int $i Page number for paginated posts' page links. * @param int $i Page number for paginated posts' page links.
*/ */
$link = apply_filters( 'wp_link_pages_link', $link, $i ); $link = apply_filters( 'wp_link_pages_link', $link, $i );
$output .= $r['separator'] . $link;
// Use the custom links separator beginning with the second link.
$output .= ( 1 === $i ) ? ' ' : $r['separator'];
$output .= $link;
} }
$output .= $r['after']; $output .= $r['after'];
} elseif ( $more ) { } elseif ( $more ) {
@ -797,16 +800,17 @@ function wp_link_pages( $args = '' ) {
$link = _wp_link_page( $prev ) . $r['link_before'] . $r['previouspagelink'] . $r['link_after'] . '</a>'; $link = _wp_link_page( $prev ) . $r['link_before'] . $r['previouspagelink'] . $r['link_after'] . '</a>';
/** This filter is documented in wp-includes/post-template.php */ /** This filter is documented in wp-includes/post-template.php */
$link = apply_filters( 'wp_link_pages_link', $link, $prev ); $output .= apply_filters( 'wp_link_pages_link', $link, $prev );
$output .= $r['separator'] . $link;
} }
$next = $page + 1; $next = $page + 1;
if ( $next <= $numpages ) { if ( $next <= $numpages ) {
if ( $prev ) {
$output .= $r['separator'];
}
$link = _wp_link_page( $next ) . $r['link_before'] . $r['nextpagelink'] . $r['link_after'] . '</a>'; $link = _wp_link_page( $next ) . $r['link_before'] . $r['nextpagelink'] . $r['link_after'] . '</a>';
/** This filter is documented in wp-includes/post-template.php */ /** This filter is documented in wp-includes/post-template.php */
$link = apply_filters( 'wp_link_pages_link', $link, $next ); $output .= apply_filters( 'wp_link_pages_link', $link, $next );
$output .= $r['separator'] . $link;
} }
$output .= $r['after']; $output .= $r['after'];
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.1-alpha-30029'; $wp_version = '4.1-alpha-30030';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.