Make WordPress Core

Changeset 30030


Ignore:
Timestamp:
10/26/2014 10:40:07 PM (9 years ago)
Author:
johnbillion
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-template.php

    r29914 r30030  
    788788                 */
    789789                $link = apply_filters( 'wp_link_pages_link', $link, $i );
    790                 $output .= $r['separator'] . $link;
     790
     791                // Use the custom links separator beginning with the second link.
     792                $output .= ( 1 === $i ) ? ' ' : $r['separator'];
     793                $output .= $link;
    791794            }
    792795            $output .= $r['after'];
     
    798801
    799802                /** This filter is documented in wp-includes/post-template.php */
    800                 $link = apply_filters( 'wp_link_pages_link', $link, $prev );
    801                 $output .= $r['separator'] . $link;
     803                $output .= apply_filters( 'wp_link_pages_link', $link, $prev );
    802804            }
    803805            $next = $page + 1;
    804806            if ( $next <= $numpages ) {
     807                if ( $prev ) {
     808                    $output .= $r['separator'];
     809                }
    805810                $link = _wp_link_page( $next ) . $r['link_before'] . $r['nextpagelink'] . $r['link_after'] . '</a>';
    806811
    807812                /** This filter is documented in wp-includes/post-template.php */
    808                 $link = apply_filters( 'wp_link_pages_link', $link, $next );
    809                 $output .= $r['separator'] . $link;
     813                $output .= apply_filters( 'wp_link_pages_link', $link, $next );
    810814            }
    811815            $output .= $r['after'];
Note: See TracChangeset for help on using the changeset viewer.