Make WordPress Core


Ignore:
Timestamp:
11/04/2010 03:00:55 PM (14 years ago)
Author:
scribu
Message:

Default to get_current_screen() in list table classes. See #14579

File:
1 edited

Legend:

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

    r16127 r16182  
    7777     * @access protected
    7878     */
    79     function WP_List_Table( $args ) {
     79    function WP_List_Table( $args = array() ) {
    8080        $args = wp_parse_args( $args, array(
    81             'screen' => '',
     81            'screen' => get_current_screen(),
    8282            'plural' => '',
    8383            'singular' => '',
     
    633633     */
    634634    function get_table_classes() {
    635         extract( $this->_args );
    636 
    637         return array( 'widefat', 'fixed', $plural );
     635        return array( 'widefat', 'fixed', $this->_args['plural'] );
    638636    }
    639637
     
    808806     */
    809807    function _js_vars() {
    810         extract( $this->_args );
    811 
    812         $class = get_class( $this );
    813 
    814         printf( "<script type='text/javascript'>list_args = %s;</script>\n",
    815             json_encode( compact( 'screen', 'class' ) )
     808        $args = array(
     809            'class' => get_class( $this ),
     810            'screen' => $this->_screen
    816811        );
     812
     813        printf( "<script type='text/javascript'>list_args = %s;</script>\n", json_encode( $args ) );
    817814    }
    818815}
Note: See TracChangeset for help on using the changeset viewer.