Make WordPress Core


Ignore:
Timestamp:
09/19/2012 12:43:31 PM (13 years ago)
Author:
ryan
Message:

Reduce reliance on global variables in the list tables. Allow passing a screen ID to the list tables so that ajax handlers can set the needed screen.

Props nacin
fixes #21871

File:
1 edited

Legend:

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

    r21755 r21914  
    1313    var $is_site_themes;
    1414
    15     function __construct() {
     15    function __construct( $args = array() ) {
    1616        global $status, $page;
     17
     18        parent::__construct( array(
     19            'plural' => 'themes',
     20            'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
     21        ) );
    1722
    1823        $status = isset( $_REQUEST['theme_status'] ) ? $_REQUEST['theme_status'] : 'all';
     
    2227        $page = $this->get_pagenum();
    2328
    24         $screen = get_current_screen();
    25         $this->is_site_themes = ( 'site-themes-network' == $screen->id ) ? true : false;
     29        $this->is_site_themes = ( 'site-themes-network' == $this->screen->id ) ? true : false;
    2630
    2731        if ( $this->is_site_themes )
    2832            $this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
    29 
    30         parent::__construct( array(
    31             'plural' => 'themes'
    32         ) );
    3333    }
    3434
Note: See TracChangeset for help on using the changeset viewer.