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

    r28293 r28493  
    1010class WP_Media_List_Table extends WP_List_Table {
    1111
    12     function __construct( $args = array() ) {
     12    public function __construct( $args = array() ) {
    1313        $this->detached = isset( $_REQUEST['detached'] ) || isset( $_REQUEST['find_detached'] );
    1414
     
    1919    }
    2020
    21     function ajax_user_can() {
     21    public function ajax_user_can() {
    2222        return current_user_can('upload_files');
    2323    }
    2424
    25     function prepare_items() {
     25    public function prepare_items() {
    2626        global $lost, $wp_query, $post_mime_types, $avail_post_mime_types;
    2727
     
    4242    }
    4343
    44     function get_views() {
     44    protected function get_views() {
    4545        global $wpdb, $post_mime_types, $avail_post_mime_types;
    4646
     
    7575    }
    7676
    77     function get_bulk_actions() {
     77    protected function get_bulk_actions() {
    7878        $actions = array();
    7979        $actions['delete'] = __( 'Delete Permanently' );
     
    8484    }
    8585
    86     function extra_tablenav( $which ) {
     86    protected function extra_tablenav( $which ) {
    8787?>
    8888        <div class="alignleft actions">
     
    105105    }
    106106
    107     function current_action() {
     107    public function current_action() {
    108108        if ( isset( $_REQUEST['find_detached'] ) )
    109109            return 'find_detached';
     
    118118    }
    119119
    120     function has_items() {
     120    public function has_items() {
    121121        return have_posts();
    122122    }
    123123
    124     function no_items() {
     124    public function no_items() {
    125125        _e( 'No media attachments found.' );
    126126    }
    127127
    128     function get_columns() {
     128    protected function get_columns() {
    129129        $posts_columns = array();
    130130        $posts_columns['cb'] = '<input type="checkbox" />';
     
    181181    }
    182182
    183     function get_sortable_columns() {
     183    protected function get_sortable_columns() {
    184184        return array(
    185185            'title'    => 'title',
     
    191191    }
    192192
    193     function display_rows() {
     193    protected function display_rows() {
    194194        global $post;
    195195
     
    422422    }
    423423
    424     function _get_row_actions( $post, $att_title ) {
     424    private function _get_row_actions( $post, $att_title ) {
    425425        $actions = array();
    426426
Note: See TracChangeset for help on using the changeset viewer.