Make WordPress Core

Changeset 16182


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

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

Location:
trunk/wp-admin/includes
Files:
14 edited

Legend:

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

    r16175 r16182  
    3131
    3232                parent::WP_List_Table( array(
    33                         'screen' => 'edit-comments',
    3433                        'plural' => 'comments'
    3534                ) );
  • trunk/wp-admin/includes/class-wp-links-list-table.php

    r16175 r16182  
    1111        function WP_Links_List_Table() {
    1212                parent::WP_List_Table( array(
    13                         'screen' => 'link-manager',
    1413                        'plural' => 'bookmarks',
    1514                ) );
  • 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}
  • trunk/wp-admin/includes/class-wp-ms-sites-list-table.php

    r16175 r16182  
    1111        function WP_MS_Sites_List_Table() {
    1212                parent::WP_List_Table( array(
    13                         'screen' => 'sites-network',
    1413                        'plural' => 'sites',
    1514                ) );
  • trunk/wp-admin/includes/class-wp-ms-themes-list-table.php

    r16175 r16182  
    2424
    2525                parent::WP_List_Table( array(
    26                         'screen' => 'themes',
    2726                        'plural' => 'plugins', // @todo replace with themes and add css
    2827                ) );
  • trunk/wp-admin/includes/class-wp-ms-users-list-table.php

    r16175 r16182  
    1111        function WP_MS_Users_List_Table() {
    1212                parent::WP_List_Table( array(
    13                         'screen' => 'users-network',
     13                        'plural' => 'users'
    1414                ) );
    1515        }
  • trunk/wp-admin/includes/class-wp-plugin-install-list-table.php

    r16175 r16182  
    88 */
    99class WP_Plugin_Install_List_Table extends WP_List_Table {
    10 
    11         function WP_Plugin_Install_List_Table() {
    12                 parent::WP_List_Table( array(
    13                         'screen' => 'plugin-install',
    14                 ) );
    15         }
    1610
    1711        function check_permissions() {
  • trunk/wp-admin/includes/class-wp-plugins-list-table.php

    r16175 r16182  
    2424
    2525                parent::WP_List_Table( array(
    26                         'screen' => 'plugins',
    2726                        'plural' => 'plugins',
    2827                ) );
  • trunk/wp-admin/includes/class-wp-posts-list-table.php

    r16175 r16182  
    4646
    4747        function WP_Posts_List_Table() {
    48                 global $post_type_object, $post_type, $current_screen, $wpdb;
     48                global $post_type_object, $post_type, $wpdb;
    4949
    5050                if ( !isset( $_REQUEST['post_type'] ) )
    … …  
    7575
    7676                parent::WP_List_Table( array(
    77                         'screen' => $current_screen,
    7877                        'plural' => 'posts',
    7978                ) );
  • trunk/wp-admin/includes/class-wp-terms-list-table.php

    r16175 r16182  
    1212
    1313        function WP_Terms_List_Table() {
    14                 global $post_type, $taxonomy, $tax, $current_screen;
     14                global $post_type, $taxonomy, $tax;
    1515
    1616                wp_reset_vars( array( 'action', 'taxonomy', 'post_type' ) );
    … …  
    2727                        $post_type = 'post';
    2828
    29                 if ( !isset( $current_screen ) )
    30                         set_current_screen( 'edit-' . $taxonomy );
    31 
    3229                parent::WP_List_Table( array(
    33                         'screen' => $current_screen,
    3430                        'plural' => 'tags',
    3531                        'singular' => 'tag',
  • trunk/wp-admin/includes/class-wp-theme-install-list-table.php

    r16175 r16182  
    88 */
    99class WP_Theme_Install_List_Table extends WP_List_Table {
    10 
    11         function WP_Theme_Install_List_Table() {
    12                 parent::WP_List_Table( array(
    13                         'screen' => 'theme-install',
    14                 ) );
    15         }
    1610
    1711        function check_permissions() {
  • trunk/wp-admin/includes/class-wp-themes-list-table.php

    r16175 r16182  
    1111        var $search = array();
    1212        var $features = array();
    13 
    14         function WP_Themes_List_Table() {
    15                 parent::__construct( array(
    16                         'screen' => 'themes',
    17                 ) );
    18         }
    1913
    2014        function check_permissions() {
  • trunk/wp-admin/includes/class-wp-users-list-table.php

    r16175 r16182  
    88 */
    99class WP_Users_List_Table extends WP_List_Table {
    10 
    11         function WP_Users_List_Table() {
    12                 parent::WP_List_Table( array(
    13                         'screen' => 'users',
    14                         'plural' => 'users'
    15                 ) );
    16         }
    1710
    1811        function check_permissions() {
  • trunk/wp-admin/includes/deprecated.php

    r15748 r16182  
    732732        var $_columns = array();
    733733
    734         function _WP_List_Table_Compat( $screen) {
     734        function _WP_List_Table_Compat( $screen ) {
    735735                parent::WP_List_Table( array(
    736736                        'screen' => $screen,
Note: See TracChangeset for help on using the changeset viewer.