Make WordPress Core

Ticket #10219: 10219.diff

File 10219.diff, 2.3 KB (added by obenland, 9 years ago)

It's not pretty.

  • src/wp-content/themes/twentythirteen/functions.php

     
    259259        global $wp_query;
    260260
    261261        // Don't print empty markup if there's only one page.
    262         if ( $wp_query->max_num_pages < 2 )
     262        if ( $wp_query->max_num_pages < 2 ) {
    263263                return;
     264        }
     265
     266        $desc       = 'DESC' === get_query_var( 'order' );
     267        $next_posts = __( '<span class="meta-nav">&larr;</span> Older posts', 'twentythirteen' );
     268        $prev_posts = __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentythirteen' );
     269
    264270        ?>
    265271        <nav class="navigation paging-navigation" role="navigation">
    266272                <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentythirteen' ); ?></h1>
    267273                <div class="nav-links">
    268274
    269275                        <?php if ( get_next_posts_link() ) : ?>
    270                         <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentythirteen' ) ); ?></div>
     276                        <div class="nav-<?php echo $desc ? 'previous' : 'next'; ?>"><?php next_posts_link( $desc ? $next_posts : $prev_posts ); ?></div>
    271277                        <?php endif; ?>
    272278
    273279                        <?php if ( get_previous_posts_link() ) : ?>
    274                         <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?></div>
     280                        <div class="nav-<?php echo $desc ? 'next' : 'previous'; ?>"><?php previous_posts_link( $desc ? $prev_posts : $next_posts ); ?></div>
    275281                        <?php endif; ?>
    276282
    277283                </div><!-- .nav-links -->
  • src/wp-includes/link-template.php

     
    24282428
    24292429        // Don't print empty markup if there's only one page.
    24302430        if ( $GLOBALS['wp_query']->max_num_pages > 1 ) {
     2431                $desc = 'DESC' === get_query_var( 'order' );
    24312432                $args = wp_parse_args( $args, array(
    2432                         'prev_text'          => __( 'Older posts' ),
    2433                         'next_text'          => __( 'Newer posts' ),
     2433                        'prev_text'          => $desc ? __( 'Older posts' ) : __( 'Newer posts' ),
     2434                        'next_text'          => $desc ? __( 'Newer posts' ) : __( 'Older posts' ),
    24342435                        'screen_reader_text' => __( 'Posts navigation' ),
    24352436                ) );
    24362437