Ticket #16682: 16682.2.diff
| File 16682.2.diff, 10.2 KB (added by aaroncampbell, 2 years ago) |
|---|
-
wp-admin/includes/class-wp-list-table.php
24 24 * @var array 25 25 * @access protected 26 26 */ 27 var$items;27 protected $items; 28 28 29 29 /** 30 30 * Various information about the current table … … 33 33 * @var array 34 34 * @access private 35 35 */ 36 var$_args;36 private $_args; 37 37 38 38 /** 39 39 * Various information needed for displaying the pagination … … 42 42 * @var array 43 43 * @access private 44 44 */ 45 var$_pagination_args = array();45 private $_pagination_args = array(); 46 46 47 47 /** 48 48 * The current screen … … 51 51 * @var object 52 52 * @access protected 53 53 */ 54 var$screen;54 protected $screen; 55 55 56 56 /** 57 57 * Cached bulk actions … … 60 60 * @var array 61 61 * @access private 62 62 */ 63 var$_actions;63 private $_actions; 64 64 65 65 /** 66 66 * Cached pagination output … … 69 69 * @var string 70 70 * @access private 71 71 */ 72 var$_pagination;72 private $_pagination; 73 73 74 74 /** 75 75 * Constructor. The child class should call this constructor from it's own constructor … … 77 77 * @param array $args An associative array with information about the current table 78 78 * @access protected 79 79 */ 80 function WP_List_Table( $args = array() ) {80 protected function WP_List_Table( $args = array() ) { 81 81 $args = wp_parse_args( $args, array( 82 82 'plural' => '', 83 83 'singular' => '', … … 107 107 * @access public 108 108 * @abstract 109 109 */ 110 function ajax_user_can() {110 public function ajax_user_can() { 111 111 die( 'function WP_List_Table::ajax_user_can() must be over-ridden in a sub-class.' ); 112 112 } 113 113 … … 119 119 * @access public 120 120 * @abstract 121 121 */ 122 function prepare_items() {122 public function prepare_items() { 123 123 die( 'function WP_List_Table::prepare_items() must be over-ridden in a sub-class.' ); 124 124 } 125 125 … … 129 129 * @param array $args An associative array with information about the pagination 130 130 * @access protected 131 131 */ 132 function set_pagination_args( $args ) {132 protected function set_pagination_args( $args ) { 133 133 $args = wp_parse_args( $args, array( 134 134 'total_items' => 0, 135 135 'total_pages' => 0, … … 151 151 * @param string $key 152 152 * @return array 153 153 */ 154 function get_pagination_arg( $key ) {154 public function get_pagination_arg( $key ) { 155 155 if ( 'page' == $key ) 156 156 return $this->get_pagenum(); 157 157 … … 167 167 * 168 168 * @return bool 169 169 */ 170 function has_items() {170 public function has_items() { 171 171 return !empty( $this->items ); 172 172 } 173 173 … … 177 177 * @since 3.1.0 178 178 * @access public 179 179 */ 180 function no_items() {180 public function no_items() { 181 181 _e( 'No items found.' ); 182 182 } 183 183 … … 190 190 * @param string $text The search button text 191 191 * @param string $input_id The search input id 192 192 */ 193 function search_box( $text, $input_id ) {193 public function search_box( $text, $input_id ) { 194 194 if ( empty( $_REQUEST['s'] ) && !$this->has_items() ) 195 195 return; 196 196 … … 218 218 * 219 219 * @return array 220 220 */ 221 function get_views() {221 protected function get_views() { 222 222 return array(); 223 223 } 224 224 … … 228 228 * @since 3.1.0 229 229 * @access public 230 230 */ 231 function views() {231 public function views() { 232 232 $screen = get_current_screen(); 233 233 234 234 $views = $this->get_views(); … … 254 254 * 255 255 * @return array 256 256 */ 257 function get_bulk_actions() {257 protected function get_bulk_actions() { 258 258 return array(); 259 259 } 260 260 … … 264 264 * @since 3.1.0 265 265 * @access public 266 266 */ 267 function bulk_actions() {267 public function bulk_actions() { 268 268 $screen = get_current_screen(); 269 269 270 270 if ( is_null( $this->_actions ) ) { … … 298 298 * 299 299 * @return string|bool The action name or False if no action was selected 300 300 */ 301 function current_action() {301 public function current_action() { 302 302 if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) 303 303 return $_REQUEST['action']; 304 304 … … 318 318 * @param bool $always_visible Wether the actions should be always visible 319 319 * @return string 320 320 */ 321 function row_actions( $actions, $always_visible = false ) {321 protected function row_actions( $actions, $always_visible = false ) { 322 322 $action_count = count( $actions ); 323 323 $i = 0; 324 324 … … 342 342 * @since 3.1.0 343 343 * @access protected 344 344 */ 345 function months_dropdown( $post_type ) {345 protected function months_dropdown( $post_type ) { 346 346 global $wpdb, $wp_locale; 347 347 348 348 $months = $wpdb->get_results( $wpdb->prepare( " … … 386 386 * @since 3.1.0 387 387 * @access protected 388 388 */ 389 function view_switcher( $current_mode ) {389 protected function view_switcher( $current_mode ) { 390 390 $modes = array( 391 391 'list' => __( 'List View' ), 392 392 'excerpt' => __( 'Excerpt View' ) … … 414 414 * @param int $post_id 415 415 * @param int $pending_comments 416 416 */ 417 function comments_bubble( $post_id, $pending_comments ) {417 protected function comments_bubble( $post_id, $pending_comments ) { 418 418 $pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) ); 419 419 420 420 if ( $pending_comments ) … … 434 434 * 435 435 * @return int 436 436 */ 437 function get_pagenum() {437 protected function get_pagenum() { 438 438 $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0; 439 439 440 440 if( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) … … 451 451 * 452 452 * @return int 453 453 */ 454 function get_items_per_page( $option, $default = 20 ) {454 protected function get_items_per_page( $option, $default = 20 ) { 455 455 $per_page = (int) get_user_option( $option ); 456 456 if ( empty( $per_page ) || $per_page < 1 ) 457 457 $per_page = $default; … … 465 465 * @since 3.1.0 466 466 * @access protected 467 467 */ 468 function pagination( $which ) {468 protected function pagination( $which ) { 469 469 if ( empty( $this->_pagination_args ) ) 470 470 return; 471 471 … … 547 547 * 548 548 * @return array 549 549 */ 550 function get_columns() {550 protected function get_columns() { 551 551 die( 'function WP_List_Table::get_columns() must be over-ridden in a sub-class.' ); 552 552 } 553 553 … … 564 564 * 565 565 * @return array 566 566 */ 567 function get_sortable_columns() {567 protected function get_sortable_columns() { 568 568 return array(); 569 569 } 570 570 … … 576 576 * 577 577 * @return array 578 578 */ 579 function get_column_info() {579 protected function get_column_info() { 580 580 if ( isset( $this->_column_headers ) ) 581 581 return $this->_column_headers; 582 582 … … 612 612 * 613 613 * @return int 614 614 */ 615 function get_column_count() {615 public function get_column_count() { 616 616 list ( $columns, $hidden ) = $this->get_column_info(); 617 617 $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) ); 618 618 return count( $columns ) - count( $hidden ); … … 626 626 * 627 627 * @param bool $with_id Whether to set the id attribute or not 628 628 */ 629 function print_column_headers( $with_id = true ) {629 protected function print_column_headers( $with_id = true ) { 630 630 $screen = get_current_screen(); 631 631 632 632 list( $columns, $hidden, $sortable ) = $this->get_column_info(); … … 689 689 * @since 3.1.0 690 690 * @access public 691 691 */ 692 function display() {692 public function display() { 693 693 extract( $this->_args ); 694 694 695 695 $this->display_tablenav( 'top' ); … … 724 724 * 725 725 * @return array 726 726 */ 727 function get_table_classes() {727 protected function get_table_classes() { 728 728 return array( 'widefat', 'fixed', $this->_args['plural'] ); 729 729 } 730 730 … … 734 734 * @since 3.1.0 735 735 * @access protected 736 736 */ 737 function display_tablenav( $which ) {737 protected function display_tablenav( $which ) { 738 738 if ( 'top' == $which ) 739 739 wp_nonce_field( 'bulk-' . $this->_args['plural'] ); 740 740 ?> … … 759 759 * @since 3.1.0 760 760 * @access protected 761 761 */ 762 function extra_tablenav( $which ) {}762 protected function extra_tablenav( $which ) {} 763 763 764 764 /** 765 765 * Generate the <tbody> part of the table … … 767 767 * @since 3.1.0 768 768 * @access protected 769 769 */ 770 function display_rows_or_placeholder() {770 protected function display_rows_or_placeholder() { 771 771 if ( $this->has_items() ) { 772 772 $this->display_rows(); 773 773 } else { … … 784 784 * @since 3.1.0 785 785 * @access protected 786 786 */ 787 function display_rows() {787 protected function display_rows() { 788 788 foreach ( $this->items as $item ) 789 789 $this->single_row( $item ); 790 790 } … … 797 797 * 798 798 * @param object $item The current item 799 799 */ 800 function single_row( $item ) {800 protected function single_row( $item ) { 801 801 static $row_class = ''; 802 802 $row_class = ( $row_class == '' ? ' class="alternate"' : '' ); 803 803 … … 814 814 * 815 815 * @param object $item The current item 816 816 */ 817 function single_row_columns( $item ) {817 protected function single_row_columns( $item ) { 818 818 list( $columns, $hidden ) = $this->get_column_info(); 819 819 820 820 foreach ( $columns as $column_name => $column_display_name ) { … … 850 850 * @since 3.1.0 851 851 * @access public 852 852 */ 853 function ajax_response() {853 public function ajax_response() { 854 854 $this->prepare_items(); 855 855 856 856 extract( $this->_args ); … … 882 882 * 883 883 * @access private 884 884 */ 885 function _js_vars() {885 private function _js_vars() { 886 886 $args = array( 887 887 'class' => get_class( $this ), 888 888 'screen' => get_current_screen() -
wp-admin/includes/class-wp-posts-list-table.php
16 16 * @var bool 17 17 * @access protected 18 18 */ 19 var$hierarchical_display;19 protected $hierarchical_display; 20 20 21 21 /** 22 22 * Holds the number of pending comments for each post … … 25 25 * @var int 26 26 * @access protected 27 27 */ 28 var$comment_pending_count;28 protected $comment_pending_count; 29 29 30 30 /** 31 31 * Holds the number of posts for this user … … 34 34 * @var int 35 35 * @access private 36 36 */ 37 var$user_posts_count;37 private $user_posts_count; 38 38 39 39 /** 40 40 * Holds the number of posts which are sticky. … … 43 43 * @var int 44 44 * @access private 45 45 */ 46 var$sticky_posts_count = 0;46 private $sticky_posts_count = 0; 47 47 48 48 function WP_Posts_List_Table() { 49 49 global $post_type_object, $post_type, $wpdb;
