Changeset 28493 for trunk/src/wp-admin/includes/class-wp-list-table.php
- Timestamp:
- 05/19/2014 01:16:16 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 ),
Note: See TracChangeset
for help on using the changeset viewer.