Make WordPress Core


Ignore:
Timestamp:
01/16/2011 09:34:38 PM (16 years ago)
Author:
nacin
Message:

Revert [17270], [17273], see #16166, see #16262.

File:
1 edited

Legend:

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

    r17297 r17321  
    619619                return count( $columns ) - count( $hidden );
    620620        }
    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'] )
    628643                        $current_order = 'desc';
    629644                else
    630645                        $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.0
    649          * @access protected
    650          *
    651          * @param bool $with_id Whether to set the id attribute or not
    652          */
    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();
    661646
    662647                foreach ( $columns as $column_key => $column_display_name ) {
    … …  
    753738         */
    754739        function display_tablenav( $which ) {
    755                 if ( 'top' == $which ) {
     740                if ( 'top' == $which )
    756741                        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                 }
    760742?>
    761743        <div class="tablenav <?php echo esc_attr( $which ); ?>">
Note: See TracChangeset for help on using the changeset viewer.