Make WordPress Core


Ignore:
Timestamp:
05/19/2014 01:16:16 AM (10 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-themes-list-table.php

    r27507 r28493  
    1111
    1212    protected $search_terms = array();
    13     var $features = array();
    14 
    15     function __construct( $args = array() ) {
     13    public $features = array();
     14
     15    public function __construct( $args = array() ) {
    1616        parent::__construct( array(
    1717            'ajax' => true,
     
    2020    }
    2121
    22     function ajax_user_can() {
     22    public function ajax_user_can() {
    2323        // Do not check edit_theme_options here. AJAX calls for available themes require switch_themes.
    2424        return current_user_can( 'switch_themes' );
    2525    }
    2626
    27     function prepare_items() {
     27    public function prepare_items() {
    2828        $themes = wp_get_themes( array( 'allowed' => true ) );
    2929
     
    5858    }
    5959
    60     function no_items() {
     60    public function no_items() {
    6161        if ( $this->search_terms || $this->features ) {
    6262            _e( 'No items found.' );
     
    8686    }
    8787
    88     function tablenav( $which = 'top' ) {
     88    public function tablenav( $which = 'top' ) {
    8989        if ( $this->get_pagination_arg( 'total_pages' ) <= 1 )
    9090            return;
     
    9898    }
    9999
    100     function display() {
     100    public function display() {
    101101        wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
    102102?>
     
    111111    }
    112112
    113     function get_columns() {
     113    protected function get_columns() {
    114114        return array();
    115115    }
    116116
    117     function display_rows_or_placeholder() {
     117    protected function display_rows_or_placeholder() {
    118118        if ( $this->has_items() ) {
    119119            $this->display_rows();
     
    125125    }
    126126
    127     function display_rows() {
     127    protected function display_rows() {
    128128        $themes = $this->items;
    129129
     
    209209    }
    210210
    211     function search_theme( $theme ) {
     211    public function search_theme( $theme ) {
    212212        // Search the features
    213213        foreach ( $this->features as $word ) {
     
    250250     * @uses _pagination_args['total_pages']
    251251     */
    252     function _js_vars( $extra_args = array() ) {
     252    private function _js_vars( $extra_args = array() ) {
    253253        $search_string = isset( $_REQUEST['s'] ) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : '';
    254254
Note: See TracChangeset for help on using the changeset viewer.