Changeset 28493
- Timestamp:
- 05/19/2014 01:16:16 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-links-list-table.php
r27029 r28493 10 10 class WP_Links_List_Table extends WP_List_Table { 11 11 12 function __construct( $args = array() ) {12 public function __construct( $args = array() ) { 13 13 parent::__construct( array( 14 14 'plural' => 'bookmarks', … … 17 17 } 18 18 19 function ajax_user_can() {19 public function ajax_user_can() { 20 20 return current_user_can( 'manage_links' ); 21 21 } 22 22 23 function prepare_items() {23 public function prepare_items() { 24 24 global $cat_id, $s, $orderby, $order; 25 25 … … 40 40 } 41 41 42 function no_items() {42 public function no_items() { 43 43 _e( 'No links found.' ); 44 44 } 45 45 46 function get_bulk_actions() {46 protected function get_bulk_actions() { 47 47 $actions = array(); 48 48 $actions['delete'] = __( 'Delete' ); … … 51 51 } 52 52 53 function extra_tablenav( $which ) {53 protected function extra_tablenav( $which ) { 54 54 global $cat_id; 55 55 … … 76 76 } 77 77 78 function get_columns() {78 protected function get_columns() { 79 79 return array( 80 80 'cb' => '<input type="checkbox" />', … … 88 88 } 89 89 90 function get_sortable_columns() {90 protected function get_sortable_columns() { 91 91 return array( 92 92 'name' => 'name', … … 97 97 } 98 98 99 function display_rows() {99 protected function display_rows() { 100 100 global $cat_id; 101 101 -
trunk/src/wp-admin/includes/class-wp-list-table.php
r28389 r28493 17 17 * @access protected 18 18 */ 19 var$items;19 protected $items; 20 20 21 21 /** … … 26 26 * @access private 27 27 */ 28 var$_args;28 private $_args; 29 29 30 30 /** … … 35 35 * @access private 36 36 */ 37 var$_pagination_args = array();37 private $_pagination_args = array(); 38 38 39 39 /** … … 44 44 * @access protected 45 45 */ 46 var$screen;46 protected $screen; 47 47 48 48 /** … … 53 53 * @access private 54 54 */ 55 var$_actions;55 private $_actions; 56 56 57 57 /** … … 62 62 * @access private 63 63 */ 64 var$_pagination;64 private $_pagination; 65 65 66 66 /** … … 70 70 * @access protected 71 71 */ 72 function __construct( $args = array() ) {72 public function __construct( $args = array() ) { 73 73 $args = wp_parse_args( $args, array( 74 74 'plural' => '', … … 97 97 98 98 /** 99 * Make private properties readable for backwards compatibility 100 * 101 * @since 4.0.0 102 * @param string $name 103 * @return mixed 104 */ 105 public function __get( $name ) { 106 return $this->$name; 107 } 108 109 /** 110 * Make private/protected methods readable for backwards compatibility 111 * 112 * @since 4.0.0 113 * @param string $name 114 * @param array $arguments 115 * @return mixed 116 */ 117 public function __call( $name, $arguments ) { 118 return call_user_func_array( array( $this, $name ), $arguments ); 119 } 120 121 /** 99 122 * Checks the current user's permissions 100 123 * @uses wp_die() … … 104 127 * @abstract 105 128 */ 106 function ajax_user_can() {129 public function ajax_user_can() { 107 130 die( 'function WP_List_Table::ajax_user_can() must be over-ridden in a sub-class.' ); 108 131 } … … 116 139 * @abstract 117 140 */ 118 function prepare_items() {141 public function prepare_items() { 119 142 die( 'function WP_List_Table::prepare_items() must be over-ridden in a sub-class.' ); 120 143 } … … 126 149 * @access protected 127 150 */ 128 function set_pagination_args( $args ) {151 protected function set_pagination_args( $args ) { 129 152 $args = wp_parse_args( $args, array( 130 153 'total_items' => 0, … … 154 177 * @return array 155 178 */ 156 function get_pagination_arg( $key ) {179 public function get_pagination_arg( $key ) { 157 180 if ( 'page' == $key ) 158 181 return $this->get_pagenum(); … … 170 193 * @return bool 171 194 */ 172 function has_items() {195 public function has_items() { 173 196 return !empty( $this->items ); 174 197 } … … 180 203 * @access public 181 204 */ 182 function no_items() {205 public function no_items() { 183 206 _e( 'No items found.' ); 184 207 } … … 193 216 * @param string $input_id The search input id 194 217 */ 195 function search_box( $text, $input_id ) {218 public function search_box( $text, $input_id ) { 196 219 if ( empty( $_REQUEST['s'] ) && !$this->has_items() ) 197 220 return; … … 225 248 * @return array 226 249 */ 227 function get_views() {250 protected function get_views() { 228 251 return array(); 229 252 } … … 235 258 * @access public 236 259 */ 237 function views() {260 public function views() { 238 261 $views = $this->get_views(); 239 262 /** … … 269 292 * @return array 270 293 */ 271 function get_bulk_actions() {294 protected function get_bulk_actions() { 272 295 return array(); 273 296 } … … 279 302 * @access public 280 303 */ 281 function bulk_actions() {304 public function bulk_actions() { 282 305 if ( is_null( $this->_actions ) ) { 283 306 $no_new_actions = $this->_actions = $this->get_bulk_actions(); … … 327 350 * @return string|bool The action name or False if no action was selected 328 351 */ 329 function current_action() {352 public function current_action() { 330 353 if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) 331 354 return $_REQUEST['action']; … … 347 370 * @return string 348 371 */ 349 function row_actions( $actions, $always_visible = false ) {372 protected function row_actions( $actions, $always_visible = false ) { 350 373 $action_count = count( $actions ); 351 374 $i = 0; … … 371 394 * @access protected 372 395 */ 373 function months_dropdown( $post_type ) {396 protected function months_dropdown( $post_type ) { 374 397 global $wpdb, $wp_locale; 375 398 … … 426 449 * @access protected 427 450 */ 428 function view_switcher( $current_mode ) {451 protected function view_switcher( $current_mode ) { 429 452 $modes = array( 430 453 'list' => __( 'List View' ), … … 454 477 * @param int $pending_comments 455 478 */ 456 function comments_bubble( $post_id, $pending_comments ) {479 protected function comments_bubble( $post_id, $pending_comments ) { 457 480 $pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) ); 458 481 … … 474 497 * @return int 475 498 */ 476 function get_pagenum() {499 protected function get_pagenum() { 477 500 $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0; 478 501 … … 491 514 * @return int 492 515 */ 493 function get_items_per_page( $option, $default = 20 ) {516 protected function get_items_per_page( $option, $default = 20 ) { 494 517 $per_page = (int) get_user_option( $option ); 495 518 if ( empty( $per_page ) || $per_page < 1 ) … … 517 540 * @access protected 518 541 */ 519 function pagination( $which ) {542 protected function pagination( $which ) { 520 543 if ( empty( $this->_pagination_args ) ) { 521 544 return; … … 612 635 * @return array 613 636 */ 614 function get_columns() {637 protected function get_columns() { 615 638 die( 'function WP_List_Table::get_columns() must be over-ridden in a sub-class.' ); 616 639 } … … 629 652 * @return array 630 653 */ 631 function get_sortable_columns() {654 protected function get_sortable_columns() { 632 655 return array(); 633 656 } … … 641 664 * @return array 642 665 */ 643 function get_column_info() {666 protected function get_column_info() { 644 667 if ( isset( $this->_column_headers ) ) 645 668 return $this->_column_headers; … … 686 709 * @return int 687 710 */ 688 function get_column_count() {711 public function get_column_count() { 689 712 list ( $columns, $hidden ) = $this->get_column_info(); 690 713 $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) ); … … 700 723 * @param bool $with_id Whether to set the id attribute or not 701 724 */ 702 function print_column_headers( $with_id = true ) {725 protected function print_column_headers( $with_id = true ) { 703 726 list( $columns, $hidden, $sortable ) = $this->get_column_info(); 704 727 … … 768 791 * @access public 769 792 */ 770 function display() {793 public function display() { 771 794 $singular = $this->_args['singular']; 772 795 … … 806 829 * @return array 807 830 */ 808 function get_table_classes() {831 protected function get_table_classes() { 809 832 return array( 'widefat', 'fixed', $this->_args['plural'] ); 810 833 } … … 816 839 * @access protected 817 840 */ 818 function display_tablenav( $which ) {841 protected function display_tablenav( $which ) { 819 842 if ( 'top' == $which ) 820 843 wp_nonce_field( 'bulk-' . $this->_args['plural'] ); … … 841 864 * @access protected 842 865 */ 843 function extra_tablenav( $which ) {}866 protected function extra_tablenav( $which ) {} 844 867 845 868 /** … … 849 872 * @access protected 850 873 */ 851 function display_rows_or_placeholder() {874 protected function display_rows_or_placeholder() { 852 875 if ( $this->has_items() ) { 853 876 $this->display_rows(); … … 865 888 * @access protected 866 889 */ 867 function display_rows() {890 protected function display_rows() { 868 891 foreach ( $this->items as $item ) 869 892 $this->single_row( $item ); … … 878 901 * @param object $item The current item 879 902 */ 880 function single_row( $item ) {903 protected function single_row( $item ) { 881 904 static $row_class = ''; 882 905 $row_class = ( $row_class == '' ? ' class="alternate"' : '' ); … … 895 918 * @param object $item The current item 896 919 */ 897 function single_row_columns( $item ) {920 protected function single_row_columns( $item ) { 898 921 list( $columns, $hidden ) = $this->get_column_info(); 899 922 … … 931 954 * @access public 932 955 */ 933 function ajax_response() {956 public function ajax_response() { 934 957 $this->prepare_items(); 935 958 … … 964 987 * @access private 965 988 */ 966 function _js_vars() {989 private function _js_vars() { 967 990 $args = array( 968 991 'class' => get_class( $this ), -
trunk/src/wp-admin/includes/class-wp-media-list-table.php
r28293 r28493 10 10 class WP_Media_List_Table extends WP_List_Table { 11 11 12 function __construct( $args = array() ) {12 public function __construct( $args = array() ) { 13 13 $this->detached = isset( $_REQUEST['detached'] ) || isset( $_REQUEST['find_detached'] ); 14 14 … … 19 19 } 20 20 21 function ajax_user_can() {21 public function ajax_user_can() { 22 22 return current_user_can('upload_files'); 23 23 } 24 24 25 function prepare_items() {25 public function prepare_items() { 26 26 global $lost, $wp_query, $post_mime_types, $avail_post_mime_types; 27 27 … … 42 42 } 43 43 44 function get_views() {44 protected function get_views() { 45 45 global $wpdb, $post_mime_types, $avail_post_mime_types; 46 46 … … 75 75 } 76 76 77 function get_bulk_actions() {77 protected function get_bulk_actions() { 78 78 $actions = array(); 79 79 $actions['delete'] = __( 'Delete Permanently' ); … … 84 84 } 85 85 86 function extra_tablenav( $which ) {86 protected function extra_tablenav( $which ) { 87 87 ?> 88 88 <div class="alignleft actions"> … … 105 105 } 106 106 107 function current_action() {107 public function current_action() { 108 108 if ( isset( $_REQUEST['find_detached'] ) ) 109 109 return 'find_detached'; … … 118 118 } 119 119 120 function has_items() {120 public function has_items() { 121 121 return have_posts(); 122 122 } 123 123 124 function no_items() {124 public function no_items() { 125 125 _e( 'No media attachments found.' ); 126 126 } 127 127 128 function get_columns() {128 protected function get_columns() { 129 129 $posts_columns = array(); 130 130 $posts_columns['cb'] = '<input type="checkbox" />'; … … 181 181 } 182 182 183 function get_sortable_columns() {183 protected function get_sortable_columns() { 184 184 return array( 185 185 'title' => 'title', … … 191 191 } 192 192 193 function display_rows() {193 protected function display_rows() { 194 194 global $post; 195 195 … … 422 422 } 423 423 424 function _get_row_actions( $post, $att_title ) {424 private function _get_row_actions( $post, $att_title ) { 425 425 $actions = array(); 426 426 -
trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php
r27029 r28493 10 10 class WP_MS_Sites_List_Table extends WP_List_Table { 11 11 12 function __construct( $args = array() ) {12 public function __construct( $args = array() ) { 13 13 parent::__construct( array( 14 14 'plural' => 'sites', … … 17 17 } 18 18 19 function ajax_user_can() {19 public function ajax_user_can() { 20 20 return current_user_can( 'manage_sites' ); 21 21 } 22 22 23 function prepare_items() {23 public function prepare_items() { 24 24 global $s, $mode, $wpdb; 25 25 … … 121 121 } 122 122 123 function no_items() {123 public function no_items() { 124 124 _e( 'No sites found.' ); 125 125 } 126 126 127 function get_bulk_actions() {127 protected function get_bulk_actions() { 128 128 $actions = array(); 129 129 if ( current_user_can( 'delete_sites' ) ) … … 135 135 } 136 136 137 function pagination( $which ) {137 protected function pagination( $which ) { 138 138 global $mode; 139 139 … … 144 144 } 145 145 146 function get_columns() {146 protected function get_columns() { 147 147 $blogname_columns = ( is_subdomain_install() ) ? __( 'Domain' ) : __( 'Path' ); 148 148 $sites_columns = array( … … 170 170 } 171 171 172 function get_sortable_columns() {172 protected function get_sortable_columns() { 173 173 return array( 174 174 'blogname' => 'blogname', … … 178 178 } 179 179 180 function display_rows() {180 protected function display_rows() { 181 181 global $mode; 182 182 -
trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php
r27090 r28493 10 10 class WP_MS_Themes_List_Table extends WP_List_Table { 11 11 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() ) { 16 16 global $status, $page; 17 17 … … 33 33 } 34 34 35 function get_table_classes() {35 protected function get_table_classes() { 36 36 return array( 'widefat', 'plugins' ); // todo: remove and add CSS for .themes 37 37 } 38 38 39 function ajax_user_can() {39 public function ajax_user_can() { 40 40 if ( $this->is_site_themes ) 41 41 return current_user_can( 'manage_sites' ); … … 44 44 } 45 45 46 function prepare_items() {46 public function prepare_items() { 47 47 global $status, $totals, $page, $orderby, $order, $s; 48 48 … … 132 132 } 133 133 134 function _search_callback( $theme ) {134 public function _search_callback( $theme ) { 135 135 static $term; 136 136 if ( is_null( $term ) ) … … 153 153 154 154 // Not used by any core columns. 155 function _order_callback( $theme_a, $theme_b ) {155 public function _order_callback( $theme_a, $theme_b ) { 156 156 global $orderby, $order; 157 157 … … 168 168 } 169 169 170 function no_items() {170 public function no_items() { 171 171 if ( ! $this->has_items ) 172 172 _e( 'No themes found.' ); … … 175 175 } 176 176 177 function get_columns() {177 protected function get_columns() { 178 178 global $status; 179 179 … … 185 185 } 186 186 187 function get_sortable_columns() {187 protected function get_sortable_columns() { 188 188 return array( 189 189 'name' => 'name', … … 191 191 } 192 192 193 function get_views() {193 protected function get_views() { 194 194 global $totals, $status; 195 195 … … 234 234 } 235 235 236 function get_bulk_actions() {236 protected function get_bulk_actions() { 237 237 global $status; 238 238 … … 251 251 } 252 252 253 function display_rows() {253 protected function display_rows() { 254 254 foreach ( $this->items as $theme ) 255 255 $this->single_row( $theme ); 256 256 } 257 257 258 function single_row( $theme ) {258 protected function single_row( $theme ) { 259 259 global $status, $page, $s, $totals; 260 260 -
trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php
r28295 r28493 10 10 class WP_MS_Users_List_Table extends WP_List_Table { 11 11 12 function ajax_user_can() {12 public function ajax_user_can() { 13 13 return current_user_can( 'manage_network_users' ); 14 14 } 15 15 16 function prepare_items() {16 public function prepare_items() { 17 17 global $usersearch, $role, $wpdb, $mode; 18 18 … … 70 70 } 71 71 72 function get_bulk_actions() {72 protected function get_bulk_actions() { 73 73 $actions = array(); 74 74 if ( current_user_can( 'delete_users' ) ) … … 80 80 } 81 81 82 function no_items() {82 public function no_items() { 83 83 _e( 'No users found.' ); 84 84 } 85 85 86 function get_views() {86 protected function get_views() { 87 87 global $role; 88 88 … … 100 100 } 101 101 102 function pagination( $which ) {102 protected function pagination( $which ) { 103 103 global $mode; 104 104 … … 109 109 } 110 110 111 function get_columns() {111 protected function get_columns() { 112 112 $users_columns = array( 113 113 'cb' => '<input type="checkbox" />', … … 131 131 } 132 132 133 function get_sortable_columns() {133 protected function get_sortable_columns() { 134 134 return array( 135 135 'username' => 'login', … … 140 140 } 141 141 142 function display_rows() {142 protected function display_rows() { 143 143 global $mode; 144 144 -
trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php
r28388 r28493 10 10 class WP_Plugin_Install_List_Table extends WP_List_Table { 11 11 12 function ajax_user_can() {12 public function ajax_user_can() { 13 13 return current_user_can('install_plugins'); 14 14 } 15 15 16 function prepare_items() {16 public function prepare_items() { 17 17 include( ABSPATH . 'wp-admin/includes/plugin-install.php' ); 18 18 … … 134 134 } 135 135 136 function no_items() {136 public function no_items() { 137 137 _e( 'No plugins match your request.' ); 138 138 } 139 139 140 function get_views() {140 protected function get_views() { 141 141 global $tabs, $tab; 142 142 … … 151 151 } 152 152 153 function display_tablenav( $which ) {153 protected function display_tablenav( $which ) { 154 154 if ( 'top' == $which ) { ?> 155 155 <div class="tablenav top"> … … 175 175 } 176 176 177 function get_table_classes() {177 protected function get_table_classes() { 178 178 return array( 'widefat', $this->_args['plural'] ); 179 179 } 180 180 181 function get_columns() {181 protected function get_columns() { 182 182 return array( 183 183 'name' => _x( 'Name', 'plugin name' ), … … 188 188 } 189 189 190 function display_rows() {190 protected function display_rows() { 191 191 $plugins_allowedtags = array( 192 192 'a' => array( 'href' => array(),'title' => array(), 'target' => array() ), -
trunk/src/wp-admin/includes/class-wp-plugins-list-table.php
r27507 r28493 10 10 class WP_Plugins_List_Table extends WP_List_Table { 11 11 12 function __construct( $args = array() ) {12 public function __construct( $args = array() ) { 13 13 global $status, $page; 14 14 … … 28 28 } 29 29 30 function get_table_classes() {30 protected function get_table_classes() { 31 31 return array( 'widefat', $this->_args['plural'] ); 32 32 } 33 33 34 function ajax_user_can() {34 public function ajax_user_can() { 35 35 return current_user_can('activate_plugins'); 36 36 } 37 37 38 function prepare_items() {38 public function prepare_items() { 39 39 global $status, $plugins, $totals, $page, $orderby, $order, $s; 40 40 … … 173 173 } 174 174 175 function _search_callback( $plugin ) {175 public function _search_callback( $plugin ) { 176 176 static $term; 177 177 if ( is_null( $term ) ) … … 187 187 } 188 188 189 function _order_callback( $plugin_a, $plugin_b ) {189 public function _order_callback( $plugin_a, $plugin_b ) { 190 190 global $orderby, $order; 191 191 … … 202 202 } 203 203 204 function no_items() {204 public function no_items() { 205 205 global $plugins; 206 206 … … 211 211 } 212 212 213 function get_columns() {213 protected function get_columns() { 214 214 global $status; 215 215 … … 221 221 } 222 222 223 function get_sortable_columns() {223 protected function get_sortable_columns() { 224 224 return array(); 225 225 } 226 226 227 function get_views() {227 protected function get_views() { 228 228 global $totals, $status; 229 229 … … 269 269 } 270 270 271 function get_bulk_actions() {271 protected function get_bulk_actions() { 272 272 global $status; 273 273 … … 290 290 } 291 291 292 function bulk_actions() {292 public function bulk_actions() { 293 293 global $status; 294 294 … … 299 299 } 300 300 301 function extra_tablenav( $which ) {301 protected function extra_tablenav( $which ) { 302 302 global $status; 303 303 … … 317 317 } 318 318 319 function current_action() {319 public function current_action() { 320 320 if ( isset($_POST['clear-recent-list']) ) 321 321 return 'clear-recent-list'; … … 324 324 } 325 325 326 function display_rows() {326 protected function display_rows() { 327 327 global $status; 328 328 … … 334 334 } 335 335 336 function single_row( $item ) {336 protected function single_row( $item ) { 337 337 global $status, $page, $s, $totals; 338 338 -
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r27964 r28493 17 17 * @access protected 18 18 */ 19 var$hierarchical_display;19 protected $hierarchical_display; 20 20 21 21 /** … … 26 26 * @access protected 27 27 */ 28 var$comment_pending_count;28 protected $comment_pending_count; 29 29 30 30 /** … … 35 35 * @access private 36 36 */ 37 var$user_posts_count;37 private $user_posts_count; 38 38 39 39 /** … … 44 44 * @access private 45 45 */ 46 var$sticky_posts_count = 0;47 48 function __construct( $args = array() ) {46 private $sticky_posts_count = 0; 47 48 public function __construct( $args = array() ) { 49 49 global $post_type_object, $wpdb; 50 50 … … 75 75 } 76 76 77 function ajax_user_can() {77 public function ajax_user_can() { 78 78 return current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_posts ); 79 79 } 80 80 81 function prepare_items() {81 public function prepare_items() { 82 82 global $avail_post_stati, $wp_query, $per_page, $mode; 83 83 … … 110 110 } 111 111 112 function has_items() {112 public function has_items() { 113 113 return have_posts(); 114 114 } 115 115 116 function no_items() {116 public function no_items() { 117 117 if ( isset( $_REQUEST['post_status'] ) && 'trash' == $_REQUEST['post_status'] ) 118 118 echo get_post_type_object( $this->screen->post_type )->labels->not_found_in_trash; … … 121 121 } 122 122 123 function get_views() {123 protected function get_views() { 124 124 global $locked_post_status, $avail_post_stati; 125 125 … … 182 182 } 183 183 184 function get_bulk_actions() {184 protected function get_bulk_actions() { 185 185 $actions = array(); 186 186 … … 198 198 } 199 199 200 function extra_tablenav( $which ) {200 protected function extra_tablenav( $which ) { 201 201 global $cat; 202 202 ?> … … 240 240 } 241 241 242 function current_action() {242 public function current_action() { 243 243 if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) 244 244 return 'delete_all'; … … 247 247 } 248 248 249 function pagination( $which ) {249 protected function pagination( $which ) { 250 250 global $mode; 251 251 … … 256 256 } 257 257 258 function get_table_classes() {258 protected function get_table_classes() { 259 259 return array( 'widefat', 'fixed', is_post_type_hierarchical( $this->screen->post_type ) ? 'pages' : 'posts' ); 260 260 } 261 261 262 function get_columns() {262 protected function get_columns() { 263 263 $post_type = $this->screen->post_type; 264 264 … … 346 346 } 347 347 348 function get_sortable_columns() {348 protected function get_sortable_columns() { 349 349 return array( 350 350 'title' => 'title', … … 355 355 } 356 356 357 function display_rows( $posts = array(), $level = 0 ) {357 protected function display_rows( $posts = array(), $level = 0 ) { 358 358 global $wp_query, $per_page; 359 359 … … 370 370 } 371 371 372 function _display_rows( $posts, $level = 0 ) {372 private function _display_rows( $posts, $level = 0 ) { 373 373 global $mode; 374 374 … … 385 385 } 386 386 387 function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) {387 private function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) { 388 388 global $wpdb; 389 389 … … 477 477 * @param int $per_page 478 478 */ 479 function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {479 private function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) { 480 480 481 481 if ( ! isset( $children_pages[$parent] ) ) … … 522 522 } 523 523 524 function single_row( $post, $level = 0 ) {524 protected function single_row( $post, $level = 0 ) { 525 525 global $mode; 526 526 static $alternate; … … 880 880 * @since 3.1.0 881 881 */ 882 function inline_edit() {882 public function inline_edit() { 883 883 global $mode; 884 884 -
trunk/src/wp-admin/includes/class-wp-terms-list-table.php
r28390 r28493 10 10 class WP_Terms_List_Table extends WP_List_Table { 11 11 12 var$callback_args;13 14 function __construct( $args = array() ) {12 public $callback_args; 13 14 public function __construct( $args = array() ) { 15 15 global $post_type, $taxonomy, $action, $tax; 16 16 … … 39 39 } 40 40 41 function ajax_user_can() {41 public function ajax_user_can() { 42 42 return current_user_can( get_taxonomy( $this->screen->taxonomy )->cap->manage_terms ); 43 43 } 44 44 45 function prepare_items() {45 public function prepare_items() { 46 46 $tags_per_page = $this->get_items_per_page( 'edit_' . $this->screen->taxonomy . '_per_page' ); 47 47 … … 98 98 } 99 99 100 function has_items() {100 public function has_items() { 101 101 // todo: populate $this->items in prepare_items() 102 102 return true; 103 103 } 104 104 105 function get_bulk_actions() {105 protected function get_bulk_actions() { 106 106 $actions = array(); 107 107 $actions['delete'] = __( 'Delete' ); … … 110 110 } 111 111 112 function current_action() {112 public function current_action() { 113 113 if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && ( 'delete' == $_REQUEST['action'] || 'delete' == $_REQUEST['action2'] ) ) 114 114 return 'bulk-delete'; … … 117 117 } 118 118 119 function get_columns() {119 protected function get_columns() { 120 120 $columns = array( 121 121 'cb' => '<input type="checkbox" />', … … 135 135 } 136 136 137 function get_sortable_columns() {137 protected function get_sortable_columns() { 138 138 return array( 139 139 'name' => 'name', … … 145 145 } 146 146 147 function display_rows_or_placeholder() {147 protected function display_rows_or_placeholder() { 148 148 $taxonomy = $this->screen->taxonomy; 149 149 … … 194 194 } 195 195 196 function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) {196 private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) { 197 197 198 198 $end = $start + $per_page; … … 242 242 } 243 243 244 function single_row( $tag, $level = 0 ) {244 protected function single_row( $tag, $level = 0 ) { 245 245 global $taxonomy; 246 246 $tag = sanitize_term( $tag, $taxonomy ); … … 256 256 } 257 257 258 function column_cb( $tag ) {258 public function column_cb( $tag ) { 259 259 $default_term = get_option( 'default_' . $this->screen->taxonomy ); 260 260 … … 266 266 } 267 267 268 function column_name( $tag ) {268 public function column_name( $tag ) { 269 269 $taxonomy = $this->screen->taxonomy; 270 270 $tax = get_taxonomy( $taxonomy ); … … 340 340 } 341 341 342 function column_description( $tag ) {342 public function column_description( $tag ) { 343 343 return $tag->description; 344 344 } 345 345 346 function column_slug( $tag ) {346 public function column_slug( $tag ) { 347 347 /** This filter is documented in wp-admin/edit-tag-form.php */ 348 348 return apply_filters( 'editable_slug', $tag->slug ); 349 349 } 350 350 351 function column_posts( $tag ) {351 public function column_posts( $tag ) { 352 352 $count = number_format_i18n( $tag->count ); 353 353 … … 373 373 } 374 374 375 function column_links( $tag ) {375 public function column_links( $tag ) { 376 376 $count = number_format_i18n( $tag->count ); 377 377 if ( $count ) … … 380 380 } 381 381 382 function column_default( $tag, $column_name ) {382 public function column_default( $tag, $column_name ) { 383 383 /** 384 384 * Filter the displayed columns in the terms list table. … … 401 401 * @since 3.1.0 402 402 */ 403 function inline_edit() {403 public function inline_edit() { 404 404 $tax = get_taxonomy( $this->screen->taxonomy ); 405 405 -
trunk/src/wp-admin/includes/class-wp-theme-install-list-table.php
r28287 r28493 10 10 class WP_Theme_Install_List_Table extends WP_Themes_List_Table { 11 11 12 var$features = array();13 14 function ajax_user_can() {12 public $features = array(); 13 14 public function ajax_user_can() { 15 15 return current_user_can( 'install_themes' ); 16 16 } 17 17 18 function prepare_items() {18 public function prepare_items() { 19 19 include( ABSPATH . 'wp-admin/includes/theme-install.php' ); 20 20 … … 141 141 } 142 142 143 function no_items() {143 public function no_items() { 144 144 _e( 'No themes match your request.' ); 145 145 } 146 146 147 function get_views() {147 protected function get_views() { 148 148 global $tabs, $tab; 149 149 … … 158 158 } 159 159 160 function display() {160 public function display() { 161 161 wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 162 162 ?> … … 184 184 } 185 185 186 function display_rows() {186 protected function display_rows() { 187 187 $themes = $this->items; 188 188 foreach ( $themes as $theme ) { … … 215 215 * public 'download_link' => string 'http://wordpress.org/themes/download/magazine-basic.1.1.zip' 216 216 */ 217 function single_row( $theme ) {217 protected function single_row( $theme ) { 218 218 global $themes_allowedtags; 219 219 … … 295 295 * Prints the wrapper for the theme installer. 296 296 */ 297 function theme_installer() {297 public function theme_installer() { 298 298 ?> 299 299 <div id="theme-installer" class="wp-full-overlay expanded"> … … 324 324 * @param object $theme - A WordPress.org Theme API object. 325 325 */ 326 function theme_installer_single( $theme ) {326 public function theme_installer_single( $theme ) { 327 327 ?> 328 328 <div id="theme-installer" class="wp-full-overlay single-theme"> … … 342 342 * @param object $theme - A WordPress.org Theme API object. 343 343 */ 344 function install_theme_info( $theme ) {344 public function install_theme_info( $theme ) { 345 345 global $themes_allowedtags; 346 346 … … 409 409 * @uses $type Global; type of search. 410 410 */ 411 function _js_vars( $extra_args = array() ) {411 private function _js_vars( $extra_args = array() ) { 412 412 global $tab, $type; 413 413 parent::_js_vars( compact( 'tab', 'type' ) ); -
trunk/src/wp-admin/includes/class-wp-themes-list-table.php
r27507 r28493 11 11 12 12 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() ) { 16 16 parent::__construct( array( 17 17 'ajax' => true, … … 20 20 } 21 21 22 function ajax_user_can() {22 public function ajax_user_can() { 23 23 // Do not check edit_theme_options here. AJAX calls for available themes require switch_themes. 24 24 return current_user_can( 'switch_themes' ); 25 25 } 26 26 27 function prepare_items() {27 public function prepare_items() { 28 28 $themes = wp_get_themes( array( 'allowed' => true ) ); 29 29 … … 58 58 } 59 59 60 function no_items() {60 public function no_items() { 61 61 if ( $this->search_terms || $this->features ) { 62 62 _e( 'No items found.' ); … … 86 86 } 87 87 88 function tablenav( $which = 'top' ) {88 public function tablenav( $which = 'top' ) { 89 89 if ( $this->get_pagination_arg( 'total_pages' ) <= 1 ) 90 90 return; … … 98 98 } 99 99 100 function display() {100 public function display() { 101 101 wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 102 102 ?> … … 111 111 } 112 112 113 function get_columns() {113 protected function get_columns() { 114 114 return array(); 115 115 } 116 116 117 function display_rows_or_placeholder() {117 protected function display_rows_or_placeholder() { 118 118 if ( $this->has_items() ) { 119 119 $this->display_rows(); … … 125 125 } 126 126 127 function display_rows() {127 protected function display_rows() { 128 128 $themes = $this->items; 129 129 … … 209 209 } 210 210 211 function search_theme( $theme ) {211 public function search_theme( $theme ) { 212 212 // Search the features 213 213 foreach ( $this->features as $word ) { … … 250 250 * @uses _pagination_args['total_pages'] 251 251 */ 252 function _js_vars( $extra_args = array() ) {252 private function _js_vars( $extra_args = array() ) { 253 253 $search_string = isset( $_REQUEST['s'] ) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : ''; 254 254 -
trunk/tests/phpunit/includes/functions.php
r28480 r28493 46 46 private $foo = 'bar'; 47 47 48 function __get( $name ) {48 public function __get( $name ) { 49 49 return $this->$name; 50 50 } 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 } 51 59 } 60 61 class Basic_Subclass extends Basic_Object {} -
trunk/tests/phpunit/tests/basic.php
r28480 r28493 128 128 $this->assertEquals( 'bar', $basic->foo ); 129 129 } 130 131 function test_subclass_magic_getter() { 132 $basic = new Basic_Subclass(); 133 134 $this->assertEquals( 'bar', $basic->foo ); 135 } 136 137 function test_call_method() { 138 $basic = new Basic_Object(); 139 140 $this->assertEquals( 'maybe', $basic->callMe() ); 141 } 142 143 function test_subclass_call_method() { 144 $basic = new Basic_Subclass(); 145 146 $this->assertEquals( 'maybe', $basic->callMe() ); 147 } 130 148 }
Note: See TracChangeset
for help on using the changeset viewer.