WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/01/2011 11:19:26 PM (10 years ago)
Author:
nacin
Message:

Disabled states for first/prev and next/last pagination buttons when they should noop. see #15503.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-list-table.php

    r17156 r17202  
    481481        $page_links = array();
    482482
     483        $disable_first = $disable_last = '';
     484        if ( $current == 1 )
     485            $disable_first = ' disabled';
     486        if ( $current == $total_items )
     487            $disable_last = ' disabled';
     488
    483489        $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
    484             'first-page',
     490            'first-page' . $disable_first,
    485491            esc_attr__( 'Go to the first page' ),
    486492            esc_url( remove_query_arg( 'paged', $current_url ) ),
     
    489495
    490496        $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
    491             'prev-page',
     497            'prev-page' . $disable_first,
    492498            esc_attr__( 'Go to the previous page' ),
    493499            esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
     
    505511
    506512        $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
    507             'next-page',
     513            'next-page' . $disable_last,
    508514            esc_attr__( 'Go to the next page' ),
    509515            esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
     
    512518
    513519        $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
    514             'last-page',
     520            'last-page' . $disable_last,
    515521            esc_attr__( 'Go to the last page' ),
    516522            esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
Note: See TracChangeset for help on using the changeset viewer.