Changeset 28389
- Timestamp:
- 05/13/2014 05:26:34 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-list-table.php
r28387 r28389 518 518 */ 519 519 function pagination( $which ) { 520 if ( empty( $this->_pagination_args ) ) 520 if ( empty( $this->_pagination_args ) ) { 521 521 return; 522 523 extract( $this->_pagination_args, EXTR_SKIP ); 522 } 523 524 $total_items = $this->_pagination_args['total_items']; 525 $total_pages = $this->_pagination_args['total_pages']; 526 $infinite_scroll = false; 527 if ( isset( $this->_pagination_args['infinite_scroll'] ) ) { 528 $infinite_scroll = $this->_pagination_args['infinite_scroll']; 529 } 524 530 525 531 $output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>'; … … 534 540 535 541 $disable_first = $disable_last = ''; 536 if ( $current == 1 ) 542 if ( $current == 1 ) { 537 543 $disable_first = ' disabled'; 538 if ( $current == $total_pages ) 544 } 545 if ( $current == $total_pages ) { 539 546 $disable_last = ' disabled'; 540 547 } 541 548 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 542 549 'first-page' . $disable_first, … … 553 560 ); 554 561 555 if ( 'bottom' == $which ) 562 if ( 'bottom' == $which ) { 556 563 $html_current_page = $current; 557 else564 } else { 558 565 $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='paged' value='%s' size='%d' />", 559 566 esc_attr__( 'Current page' ), … … 561 568 strlen( $total_pages ) 562 569 ); 563 570 } 564 571 $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) ); 565 572 $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>'; … … 580 587 581 588 $pagination_links_class = 'pagination-links'; 582 if ( ! empty( $infinite_scroll ) ) 589 if ( ! empty( $infinite_scroll ) ) { 583 590 $pagination_links_class = ' hide-if-js'; 591 } 584 592 $output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>'; 585 593 586 if ( $total_pages ) 594 if ( $total_pages ) { 587 595 $page_class = $total_pages < 2 ? ' one-page' : ''; 588 else596 } else { 589 597 $page_class = ' no-pages'; 590 598 } 591 599 $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>"; 592 600
Note: See TracChangeset
for help on using the changeset viewer.