From 510ad2e1e935a902b42c041ef57f96606b0066e4 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 13 Jul 2014 22:08:22 +0000 Subject: [PATCH] Fix mismatches in access modifiers for `WP_List_Table` + subclasses. Fixes #28843, #28879. git-svn-id: https://develop.svn.wordpress.org/trunk@29137 602fd350-edb4-49c9-b593-d223f7449a82 --- .../includes/class-wp-comments-list-table.php | 12 +++++----- .../includes/class-wp-links-list-table.php | 2 +- src/wp-admin/includes/class-wp-list-table.php | 24 +++++++++---------- .../includes/class-wp-media-list-table.php | 2 +- .../class-wp-ms-themes-list-table.php | 4 ++-- .../includes/class-wp-ms-users-list-table.php | 2 +- .../class-wp-plugin-install-list-table.php | 2 +- .../includes/class-wp-plugins-list-table.php | 4 ++-- .../includes/class-wp-posts-list-table.php | 4 ++-- .../includes/class-wp-terms-list-table.php | 4 ++-- .../class-wp-theme-install-list-table.php | 8 +++---- .../includes/class-wp-themes-list-table.php | 8 +++---- .../includes/class-wp-users-list-table.php | 16 ++++++------- src/wp-admin/includes/list-table.php | 2 +- 14 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php index 0eedcd8554..958f811b9d 100644 --- a/src/wp-admin/includes/class-wp-comments-list-table.php +++ b/src/wp-admin/includes/class-wp-comments-list-table.php @@ -148,7 +148,7 @@ class WP_Comments_List_Table extends WP_List_Table { _e( 'No comments found.' ); } - public function get_views() { + protected function get_views() { global $post_id, $comment_status, $comment_type; $status_links = array(); @@ -201,7 +201,7 @@ class WP_Comments_List_Table extends WP_List_Table { return $status_links; } - public function get_bulk_actions() { + protected function get_bulk_actions() { global $comment_status; $actions = array(); @@ -225,7 +225,7 @@ class WP_Comments_List_Table extends WP_List_Table { return $actions; } - public function extra_tablenav( $which ) { + protected function extra_tablenav( $which ) { global $comment_status, $comment_type; ?>
@@ -301,7 +301,7 @@ class WP_Comments_List_Table extends WP_List_Table { return $columns; } - public function get_sortable_columns() { + protected function get_sortable_columns() { return array( 'author' => 'comment_author', 'response' => 'comment_post_ID' @@ -582,7 +582,7 @@ class WP_Comments_List_Table extends WP_List_Table { */ class WP_Post_Comments_List_Table extends WP_Comments_List_Table { - public function get_column_info() { + protected function get_column_info() { $this->_column_headers = array( array( 'author' => __( 'Author' ), @@ -595,7 +595,7 @@ class WP_Post_Comments_List_Table extends WP_Comments_List_Table { return $this->_column_headers; } - public function get_table_classes() { + protected function get_table_classes() { $classes = parent::get_table_classes(); $classes[] = 'comments-box'; return $classes; diff --git a/src/wp-admin/includes/class-wp-links-list-table.php b/src/wp-admin/includes/class-wp-links-list-table.php index 62768054bc..ae550b0b54 100644 --- a/src/wp-admin/includes/class-wp-links-list-table.php +++ b/src/wp-admin/includes/class-wp-links-list-table.php @@ -96,7 +96,7 @@ class WP_Links_List_Table extends WP_List_Table { ); } - protected function display_rows() { + public function display_rows() { global $cat_id; $alt = 0; diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php index d3e31bb1a7..33ef462ada 100644 --- a/src/wp-admin/includes/class-wp-list-table.php +++ b/src/wp-admin/includes/class-wp-list-table.php @@ -333,9 +333,9 @@ class WP_List_Table { * Display the bulk actions dropdown. * * @since 3.1.0 - * @access public + * @access protected */ - public function bulk_actions() { + protected function bulk_actions() { if ( is_null( $this->_actions ) ) { $no_new_actions = $this->_actions = $this->get_bulk_actions(); /** @@ -762,11 +762,11 @@ class WP_List_Table { * Print column headers, accounting for hidden and sortable columns. * * @since 3.1.0 - * @access protected + * @access public * * @param bool $with_id Whether to set the id attribute or not */ - protected function print_column_headers( $with_id = true ) { + public function print_column_headers( $with_id = true ) { list( $columns, $hidden, $sortable ) = $this->get_column_info(); $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); @@ -913,9 +913,9 @@ class WP_List_Table { * Generate the part of the table * * @since 3.1.0 - * @access protected + * @access public */ - protected function display_rows_or_placeholder() { + public function display_rows_or_placeholder() { if ( $this->has_items() ) { $this->display_rows(); } else { @@ -929,9 +929,9 @@ class WP_List_Table { * Generate the table rows * * @since 3.1.0 - * @access protected + * @access public */ - protected function display_rows() { + public function display_rows() { foreach ( $this->items as $item ) $this->single_row( $item ); } @@ -940,11 +940,11 @@ class WP_List_Table { * Generates content for a single row of the table * * @since 3.1.0 - * @access protected + * @access public * * @param object $item The current item */ - protected function single_row( $item ) { + public function single_row( $item ) { static $row_class = ''; $row_class = ( $row_class == '' ? ' class="alternate"' : '' ); @@ -1028,9 +1028,9 @@ class WP_List_Table { /** * Send required variables to JavaScript land * - * @access private + * @access public */ - private function _js_vars() { + public function _js_vars() { $args = array( 'class' => get_class( $this ), 'screen' => array( diff --git a/src/wp-admin/includes/class-wp-media-list-table.php b/src/wp-admin/includes/class-wp-media-list-table.php index feaa8fa583..4104f24c47 100644 --- a/src/wp-admin/includes/class-wp-media-list-table.php +++ b/src/wp-admin/includes/class-wp-media-list-table.php @@ -232,7 +232,7 @@ class WP_Media_List_Table extends WP_List_Table { ); } - protected function display_rows() { + public function display_rows() { global $post; add_filter( 'the_title','esc_html' ); diff --git a/src/wp-admin/includes/class-wp-ms-themes-list-table.php b/src/wp-admin/includes/class-wp-ms-themes-list-table.php index 038a62bf4a..a4df52d8ba 100644 --- a/src/wp-admin/includes/class-wp-ms-themes-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-themes-list-table.php @@ -250,12 +250,12 @@ class WP_MS_Themes_List_Table extends WP_List_Table { return $actions; } - protected function display_rows() { + public function display_rows() { foreach ( $this->items as $theme ) $this->single_row( $theme ); } - protected function single_row( $theme ) { + public function single_row( $theme ) { global $status, $page, $s, $totals; $context = $status; diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php index 55b274871a..a396b83888 100644 --- a/src/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-users-list-table.php @@ -139,7 +139,7 @@ class WP_MS_Users_List_Table extends WP_List_Table { ); } - protected function display_rows() { + public function display_rows() { global $mode; $alt = ''; diff --git a/src/wp-admin/includes/class-wp-plugin-install-list-table.php b/src/wp-admin/includes/class-wp-plugin-install-list-table.php index 48bddf1359..d573e138d8 100644 --- a/src/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/src/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -216,7 +216,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { ); } - protected function display_rows() { + public function display_rows() { $plugins_allowedtags = array( 'a' => array( 'href' => array(),'title' => array(), 'target' => array() ), 'abbr' => array( 'title' => array() ),'acronym' => array( 'title' => array() ), diff --git a/src/wp-admin/includes/class-wp-plugins-list-table.php b/src/wp-admin/includes/class-wp-plugins-list-table.php index cd1cd5c313..a1c0470c8c 100644 --- a/src/wp-admin/includes/class-wp-plugins-list-table.php +++ b/src/wp-admin/includes/class-wp-plugins-list-table.php @@ -323,7 +323,7 @@ class WP_Plugins_List_Table extends WP_List_Table { return parent::current_action(); } - protected function display_rows() { + public function display_rows() { global $status; if ( is_multisite() && ! $this->screen->in_admin( 'network' ) && in_array( $status, array( 'mustuse', 'dropins' ) ) ) @@ -333,7 +333,7 @@ class WP_Plugins_List_Table extends WP_List_Table { $this->single_row( array( $plugin_file, $plugin_data ) ); } - protected function single_row( $item ) { + public function single_row( $item ) { global $status, $page, $s, $totals; list( $plugin_file, $plugin_data ) = $item; diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index 377b507ab1..d46153c631 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -358,7 +358,7 @@ class WP_Posts_List_Table extends WP_List_Table { ); } - protected function display_rows( $posts = array(), $level = 0 ) { + public function display_rows( $posts = array(), $level = 0 ) { global $wp_query, $per_page; if ( empty( $posts ) ) @@ -525,7 +525,7 @@ class WP_Posts_List_Table extends WP_List_Table { unset( $children_pages[$parent] ); //required in order to keep track of orphans } - protected function single_row( $post, $level = 0 ) { + public function single_row( $post, $level = 0 ) { global $mode; static $alternate; diff --git a/src/wp-admin/includes/class-wp-terms-list-table.php b/src/wp-admin/includes/class-wp-terms-list-table.php index 605b302f2e..a8a60eab58 100644 --- a/src/wp-admin/includes/class-wp-terms-list-table.php +++ b/src/wp-admin/includes/class-wp-terms-list-table.php @@ -144,7 +144,7 @@ class WP_Terms_List_Table extends WP_List_Table { ); } - protected function display_rows_or_placeholder() { + public function display_rows_or_placeholder() { $taxonomy = $this->screen->taxonomy; $args = wp_parse_args( $this->callback_args, array( @@ -240,7 +240,7 @@ class WP_Terms_List_Table extends WP_List_Table { } } - protected function single_row( $tag, $level = 0 ) { + public function single_row( $tag, $level = 0 ) { global $taxonomy; $tag = sanitize_term( $tag, $taxonomy ); diff --git a/src/wp-admin/includes/class-wp-theme-install-list-table.php b/src/wp-admin/includes/class-wp-theme-install-list-table.php index 05491ccffe..c7c67df405 100644 --- a/src/wp-admin/includes/class-wp-theme-install-list-table.php +++ b/src/wp-admin/includes/class-wp-theme-install-list-table.php @@ -176,7 +176,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table { parent::tablenav( 'bottom' ); } - protected function display_rows() { + public function display_rows() { $themes = $this->items; foreach ( $themes as $theme ) { ?> @@ -207,7 +207,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table { * public 'description' => string 'A basic magazine style layout with a fully customizable layout through a backend interface. Designed by c.bavota of Tinker Priest Media.' * public 'download_link' => string 'http://wordpress.org/themes/download/magazine-basic.1.1.zip' */ - protected function single_row( $theme ) { + public function single_row( $theme ) { global $themes_allowedtags; if ( empty( $theme ) ) @@ -396,12 +396,12 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table { * Send required variables to JavaScript land * * @since 3.4.0 - * @access private + * @access public * * @uses $tab Global; current tab within Themes->Install screen * @uses $type Global; type of search. */ - private function _js_vars( $extra_args = array() ) { + public function _js_vars( $extra_args = array() ) { global $tab, $type; parent::_js_vars( compact( 'tab', 'type' ) ); } diff --git a/src/wp-admin/includes/class-wp-themes-list-table.php b/src/wp-admin/includes/class-wp-themes-list-table.php index 0e179802e1..e7bb626869 100644 --- a/src/wp-admin/includes/class-wp-themes-list-table.php +++ b/src/wp-admin/includes/class-wp-themes-list-table.php @@ -114,7 +114,7 @@ class WP_Themes_List_Table extends WP_List_Table { return array(); } - protected function display_rows_or_placeholder() { + public function display_rows_or_placeholder() { if ( $this->has_items() ) { $this->display_rows(); } else { @@ -124,7 +124,7 @@ class WP_Themes_List_Table extends WP_List_Table { } } - protected function display_rows() { + public function display_rows() { $themes = $this->items; foreach ( $themes as $theme ): @@ -243,13 +243,13 @@ class WP_Themes_List_Table extends WP_List_Table { * Send required variables to JavaScript land * * @since 3.4.0 - * @access private + * @access public * * @uses $this->features Array of all feature search terms. * @uses get_pagenum() * @uses _pagination_args['total_pages'] */ - private function _js_vars( $extra_args = array() ) { + public function _js_vars( $extra_args = array() ) { $search_string = isset( $_REQUEST['s'] ) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : ''; $args = array( diff --git a/src/wp-admin/includes/class-wp-users-list-table.php b/src/wp-admin/includes/class-wp-users-list-table.php index fafa6609e1..6c1a503a08 100644 --- a/src/wp-admin/includes/class-wp-users-list-table.php +++ b/src/wp-admin/includes/class-wp-users-list-table.php @@ -127,11 +127,11 @@ class WP_Users_List_Table extends WP_List_Table { * filtering of the user table. * * @since 3.1.0 - * @access public + * @access protected * * @return array An array of HTML links, one for each view. */ - public function get_views() { + protected function get_views() { global $wp_roles, $role; if ( $this->is_site_users ) { @@ -173,11 +173,11 @@ class WP_Users_List_Table extends WP_List_Table { * Retrieve an associative array of bulk actions available on this table. * * @since 3.1.0 - * @access public + * @access protected * * @return array Array of bulk actions. */ - public function get_bulk_actions() { + protected function get_bulk_actions() { $actions = array(); if ( is_multisite() ) { @@ -195,12 +195,12 @@ class WP_Users_List_Table extends WP_List_Table { * Output the controls to allow user roles to be changed in bulk. * * @since 3.1.0 - * @access public + * @access protected * * @param string $which Whether this is being invoked above ("top") * or below the table ("bottom"). */ - public function extra_tablenav( $which ) { + protected function extra_tablenav( $which ) { if ( 'top' != $which ) return; ?> @@ -272,11 +272,11 @@ class WP_Users_List_Table extends WP_List_Table { * Get a list of sortable columns for the list table. * * @since 3.1.0 - * @access public + * @access protected * * @return array Array of sortable columns. */ - public function get_sortable_columns() { + protected function get_sortable_columns() { $c = array( 'username' => 'login', 'name' => 'name', diff --git a/src/wp-admin/includes/list-table.php b/src/wp-admin/includes/list-table.php index 86b1e60fa5..04b552f1b3 100644 --- a/src/wp-admin/includes/list-table.php +++ b/src/wp-admin/includes/list-table.php @@ -99,7 +99,7 @@ class _WP_List_Table_Compat extends WP_List_Table { } } - public function get_column_info() { + protected function get_column_info() { $columns = get_column_headers( $this->_screen ); $hidden = get_hidden_columns( $this->_screen ); $sortable = array();