Make WordPress Core


Ignore:
Timestamp:
10/01/2015 02:09:41 AM (8 years ago)
Author:
wonderboymusic
Message:

Post List Table: Ensure that edit.php with no query string produces the proper markup and links in the date column header.

Add 2 methods to WP_List_Table, ->get_orderby() and ->get_order(). Override the methods in WP_Posts_List_Table.

WP_Posts_List_Table calls wp_edit_posts_query() in ->prepare_items() which is a wrapper for wp(). As such, we can obtain orderby and order via get_query_var(), instead of the URL.

Fixes #25493.

File:
1 edited

Legend:

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

    r34667 r34728  
    122122
    123123    /**
     124     * Get the value of the 'orderby' query var.
     125     *
     126     * @access protected
     127     * @since 4.4.0
     128     *
     129     * @return string The value of 'orderby'.
     130     */
     131    protected function get_orderby() {
     132        return strtolower( get_query_var( 'orderby' ) );
     133    }
     134
     135    /**
     136     * Get the value of the 'order' query var.
     137     *
     138     * @access protected
     139     * @since 4.4.0
     140     *
     141     * @return string The value of 'order'.
     142     */
     143    protected function get_order() {
     144        return strtolower( get_query_var( 'order' ) );
     145    }
     146
     147    /**
    124148     *
    125149     * @global array    $avail_post_stati
     
    131155        global $avail_post_stati, $wp_query, $per_page, $mode;
    132156
     157        // is going to call wp()
    133158        $avail_post_stati = wp_edit_posts_query();
    134159
Note: See TracChangeset for help on using the changeset viewer.