Make WordPress Core


Ignore:
Timestamp:
03/02/2012 11:06:31 PM (13 years ago)
Author:
nacin
Message:

Allow WP_List_Table::_js_vars() to take an array of additional args to add. Allows us to have a single variable printing data when child classes need more data. Also, fix compact() call in [20094]. see #19815.

File:
1 edited

Legend:

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

    r20094 r20100  
    218218        $search_string = isset( $_REQUEST['s'] ) ? esc_attr( stripslashes( $_REQUEST['s'] ) ) : '';
    219219
    220         $total_pages = 1;
    221         if ( ! empty( $this->_pagination_args['total_pages'] ) )
    222             $total_pages = $this->_pagination_args['total_pages'];
    223 
    224220        $args = array(
    225221            'search' => $search_string,
    226222            'features' => $this->features,
    227223            'paged' => $this->get_pagenum(),
    228             'total_pages' => $total_pages,
     224            'total_pages' => ! empty( $this->_pagination_args['total_pages'] ) ? $this->_pagination_args['total_pages'] : 1,
    229225        );
    230226
    231227        if ( is_array( $extra_args ) )
    232         $args = array_merge( $args, $extra_args );
    233 
    234         printf( "<script type='text/javascript'>var theme_list_args = %s;</script>\n", json_encode( $args ) );
    235         parent::_js_vars();
     228            $args = array_merge( $args, $extra_args );
     229
     230        parent::_js_vars( $args );
    236231    }
    237232}
Note: See TracChangeset for help on using the changeset viewer.