Changeset 17321 for trunk/wp-admin/includes/class-wp-list-table.php
- Timestamp:
- 01/16/2011 09:34:38 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/class-wp-list-table.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-list-table.php
r17297 r17321 619 619 return count( $columns ) - count( $hidden ); 620 620 } 621 622 function get_order_info() { 623 $current_orderby = isset( $_GET['orderby'] ) ? $_GET['orderby'] : ''; 624 625 if ( ! $current_orderby ) 626 $current_order = ''; 627 elseif ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) 621 622 /** 623 * Print column headers, accounting for hidden and sortable columns. 624 * 625 * @since 3.1.0 626 * @access protected 627 * 628 * @param bool $with_id Whether to set the id attribute or not 629 */ 630 function print_column_headers( $with_id = true ) { 631 $screen = get_current_screen(); 632 633 list( $columns, $hidden, $sortable ) = $this->get_column_info(); 634 635 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 636 637 if ( isset( $_GET['orderby'] ) ) 638 $current_orderby = $_GET['orderby']; 639 else 640 $current_orderby = ''; 641 642 if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) 628 643 $current_order = 'desc'; 629 644 else 630 645 $current_order = 'asc'; 631 632 return array( $current_orderby, $current_order );633 }634 635 function add_query_args( $location ) {636 $pagenum = $this->get_pagenum();637 list( $current_orderby, $current_order ) = $this->get_order_info();638 $location = add_query_arg( 'paged', $pagenum, $location );639 if ( $current_orderby )640 $location = add_query_arg( array( 'orderby' => $current_orderby, 'order' => $current_order ), $location );641 642 return $location;643 }644 645 /**646 * Print column headers, accounting for hidden and sortable columns.647 *648 * @since 3.1.0649 * @access protected650 *651 * @param bool $with_id Whether to set the id attribute or not652 */653 function print_column_headers( $with_id = true ) {654 $screen = get_current_screen();655 656 list( $columns, $hidden, $sortable ) = $this->get_column_info();657 658 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];659 660 list( $current_orderby, $current_order ) = $this->get_order_info();661 646 662 647 foreach ( $columns as $column_key => $column_display_name ) { … … 753 738 */ 754 739 function display_tablenav( $which ) { 755 if ( 'top' == $which ) {740 if ( 'top' == $which ) 756 741 wp_nonce_field( 'bulk-' . $this->_args['plural'] ); 757 list( $current_orderby, $current_order ) = $this->get_order_info();758 echo '<input type="hidden" name="orderby" value="' . esc_attr( $current_orderby ) . '" /><input type="hidden" name="order" value="' . esc_attr( $current_order ) . '" />';759 }760 742 ?> 761 743 <div class="tablenav <?php echo esc_attr( $which ); ?>">
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)