Make WordPress Core


Ignore:
Timestamp:
05/19/2014 01:16:16 AM (11 years ago)
Author:
wonderboymusic
Message:

Add access modifiers to methods and members of list table classes:

  • WP_List_Table is the base class that implements __get() and __call() for BC
  • Adds unit tests to confirm that subclasses properly inherit magic methods
  • Add modifiers to subclasses: WP_Links_List_Table, WP_Media_List_Table, WP_MS_Sites_List_Table, WP_MS_Themes_List_Table, WP_MS_Users_List_Table, WP_Plugin_Install_List_Table, WP_Plugins_List_Table, WP_Posts_List_Table, WP_Terms_List_Table, WP_Theme_Install_List_Table, WP_Themes_List_Table

See #27881, #22234.

File:
1 edited

Legend:

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

    r27090 r28493  
    1010class WP_MS_Themes_List_Table extends WP_List_Table {
    1111
    12     var $site_id;
    13     var $is_site_themes;
    14 
    15     function __construct( $args = array() ) {
     12    public $site_id;
     13    public $is_site_themes;
     14
     15    public function __construct( $args = array() ) {
    1616        global $status, $page;
    1717
     
    3333    }
    3434
    35     function get_table_classes() {
     35    protected function get_table_classes() {
    3636        return array( 'widefat', 'plugins' );   // todo: remove and add CSS for .themes
    3737    }
    3838
    39     function ajax_user_can() {
     39    public function ajax_user_can() {
    4040        if ( $this->is_site_themes )
    4141            return current_user_can( 'manage_sites' );
     
    4444    }
    4545
    46     function prepare_items() {
     46    public function prepare_items() {
    4747        global $status, $totals, $page, $orderby, $order, $s;
    4848
     
    132132    }
    133133
    134     function _search_callback( $theme ) {
     134    public function _search_callback( $theme ) {
    135135        static $term;
    136136        if ( is_null( $term ) )
     
    153153
    154154    // Not used by any core columns.
    155     function _order_callback( $theme_a, $theme_b ) {
     155    public function _order_callback( $theme_a, $theme_b ) {
    156156        global $orderby, $order;
    157157
     
    168168    }
    169169
    170     function no_items() {
     170    public function no_items() {
    171171        if ( ! $this->has_items )
    172172            _e( 'No themes found.' );
     
    175175    }
    176176
    177     function get_columns() {
     177    protected function get_columns() {
    178178        global $status;
    179179
     
    185185    }
    186186
    187     function get_sortable_columns() {
     187    protected function get_sortable_columns() {
    188188        return array(
    189189            'name'         => 'name',
     
    191191    }
    192192
    193     function get_views() {
     193    protected function get_views() {
    194194        global $totals, $status;
    195195
     
    234234    }
    235235
    236     function get_bulk_actions() {
     236    protected function get_bulk_actions() {
    237237        global $status;
    238238
     
    251251    }
    252252
    253     function display_rows() {
     253    protected function display_rows() {
    254254        foreach ( $this->items as $theme )
    255255            $this->single_row( $theme );
    256256    }
    257257
    258     function single_row( $theme ) {
     258    protected function single_row( $theme ) {
    259259        global $status, $page, $s, $totals;
    260260
Note: See TracChangeset for help on using the changeset viewer.