Making WordPress.org


Ignore:
Timestamp:
06/15/2015 06:25:44 PM (10 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/wordcamp-payments-network.php

    r1223 r1660  
    209209
    210210        self::$list_table = new WordCamp_Payments_Network_List_Table;
    211         self::$list_table->set_view( self::get_current_tab() );
    212211    }
    213212
     
    216215     */
    217216    public static function get_current_tab() {
    218         if ( isset( $_REQUEST['wcp-section'] ) )
    219             return strtolower( $_REQUEST['wcp-section'] );
    220 
    221         return 'overdue';
     217        $tab = 'overdue';
     218
     219        if ( isset( $_REQUEST['wcp-section'] ) && in_array( $_REQUEST['wcp-section'], array( 'pending', 'overdue', 'paid' ) ) ) {
     220            $tab = $_REQUEST['wcp-section'];
     221        }
     222
     223        return $tab;
    222224    }
    223225
Note: See TracChangeset for help on using the changeset viewer.