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-theme-install-list-table.php

    r28287 r28493  
    1010class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
    1111
    12     var $features = array();
    13 
    14     function ajax_user_can() {
     12    public $features = array();
     13
     14    public function ajax_user_can() {
    1515        return current_user_can( 'install_themes' );
    1616    }
    1717
    18     function prepare_items() {
     18    public function prepare_items() {
    1919        include( ABSPATH . 'wp-admin/includes/theme-install.php' );
    2020
     
    141141    }
    142142
    143     function no_items() {
     143    public function no_items() {
    144144        _e( 'No themes match your request.' );
    145145    }
    146146
    147     function get_views() {
     147    protected function get_views() {
    148148        global $tabs, $tab;
    149149
     
    158158    }
    159159
    160     function display() {
     160    public function display() {
    161161        wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
    162162?>
     
    184184    }
    185185
    186     function display_rows() {
     186    protected function display_rows() {
    187187        $themes = $this->items;
    188188        foreach ( $themes as $theme ) {
     
    215215     *     public 'download_link' => string 'http://wordpress.org/themes/download/magazine-basic.1.1.zip'
    216216     */
    217     function single_row( $theme ) {
     217    protected function single_row( $theme ) {
    218218        global $themes_allowedtags;
    219219
     
    295295     * Prints the wrapper for the theme installer.
    296296     */
    297     function theme_installer() {
     297    public function theme_installer() {
    298298        ?>
    299299        <div id="theme-installer" class="wp-full-overlay expanded">
     
    324324     * @param object $theme - A WordPress.org Theme API object.
    325325     */
    326     function theme_installer_single( $theme ) {
     326    public function theme_installer_single( $theme ) {
    327327        ?>
    328328        <div id="theme-installer" class="wp-full-overlay single-theme">
     
    342342     * @param object $theme - A WordPress.org Theme API object.
    343343     */
    344     function install_theme_info( $theme ) {
     344    public function install_theme_info( $theme ) {
    345345        global $themes_allowedtags;
    346346
     
    409409     * @uses $type Global; type of search.
    410410     */
    411     function _js_vars( $extra_args = array() ) {
     411    private function _js_vars( $extra_args = array() ) {
    412412        global $tab, $type;
    413413        parent::_js_vars( compact( 'tab', 'type' ) );
Note: See TracChangeset for help on using the changeset viewer.