Making WordPress.org


Ignore:
Timestamp:
06/15/2015 06:25:44 PM (11 years ago)
Author:
iandunn
Message:

WordCamp Payments Dashboard: Get current view from main class.

r31146-core prevents assigning new members to subclasses of WP_List_Table, which caused all items to be displayed on each tab, rather than only the items relevant to the tab.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/class-list-table.php

    r1222 r1660  
    4141
    4242    /**
    43      * This list table can display multiple views which are
    44      * essentially just filters. Use this method to set the appropriate view.
    45      */
    46     public function set_view( $view ) {
    47         $this->view = 'overdue';
    48         if ( in_array( $view, array( 'pending', 'overdue', 'paid' ) ) )
    49             $this->view = $view;
    50     }
    51 
    52     /**
    5343     * Outputs inline CSS to be used with the list table.
    5444     */
     
    7464
    7565        $sql = sprintf( "SELECT SQL_CALC_FOUND_ROWS blog_id, post_id FROM `%s` WHERE 1=1 ", WordCamp_Payments_Network_Tools::get_table_name() );
     66        $view = WordCamp_Payments_Network_Tools::get_current_tab();
    7667        $where = '';
    7768        $orderby = '';
     
    8172        $order = 'desc';
    8273
    83         if ( 'overdue' == $this->view ) {
     74        if ( 'overdue' == $view ) {
    8475            $where .= $wpdb->prepare( " AND `status` = 'unpaid' AND `due` > 0 AND `due` <= %d ", time() );
    8576            $orderby = 'due';
    8677            $order = 'asc';
    87         } elseif ( 'pending' == $this->view ) {
     78        } elseif ( 'pending' == $view ) {
    8879            $where .= " AND `status` = 'unpaid' ";
    89         } elseif ( 'paid' == $this->view ) {
     80        } elseif ( 'paid' == $view ) {
    9081            $where .= " AND `status` = 'paid' ";
    9182        }
Note: See TracChangeset for help on using the changeset viewer.