WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/19/2014 01:16:16 AM (7 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/tests/phpunit/includes/functions.php

    r28480 r28493  
    4646    private $foo = 'bar';
    4747
    48     function __get( $name ) {
     48    public function __get( $name ) {
    4949        return $this->$name;
    5050    }
     51
     52    public function __call( $name, $arguments ) {
     53        return call_user_func_array( array( $this, $name ), $arguments );
     54    }
     55
     56    private function callMe() {
     57        return 'maybe';
     58    }
    5159}
     60
     61class Basic_Subclass extends Basic_Object {}
Note: See TracChangeset for help on using the changeset viewer.