From 65ab522a5168bb981728f6a24647e811ece05aea Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 1 Dec 2014 00:33:23 +0000 Subject: [PATCH] Improve various `@param` docs for List Tables. See #30224. Built from https://develop.svn.wordpress.org/trunk@30679 git-svn-id: http://core.svn.wordpress.org/trunk@30669 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-list-table.php | 11 +++++ .../includes/class-wp-media-list-table.php | 12 ++++- .../includes/class-wp-ms-sites-list-table.php | 3 ++ .../class-wp-ms-themes-list-table.php | 19 ++++++++ .../includes/class-wp-ms-users-list-table.php | 4 ++ .../class-wp-plugin-install-list-table.php | 8 ++++ .../includes/class-wp-plugins-list-table.php | 29 ++++++++++++ .../includes/class-wp-posts-list-table.php | 32 +++++++++++++ .../includes/class-wp-terms-list-table.php | 45 +++++++++++++++++++ .../includes/class-wp-themes-list-table.php | 10 +++++ wp-includes/version.php | 2 +- 11 files changed, 172 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index ac65391f22..a90b4b8c67 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -479,6 +479,8 @@ class WP_List_Table { * * @since 3.1.0 * @access protected + * + * @param string $post_type */ protected function months_dropdown( $post_type ) { global $wpdb, $wp_locale; @@ -535,6 +537,8 @@ class WP_List_Table { * * @since 3.1.0 * @access protected + * + * @param string $current_mode */ protected function view_switcher( $current_mode ) { ?> @@ -601,6 +605,8 @@ class WP_List_Table { * @since 3.1.0 * @access protected * + * @param string $option + * @param int $default * @return int */ protected function get_items_per_page( $option, $default = 20 ) { @@ -629,6 +635,8 @@ class WP_List_Table { * * @since 3.1.0 * @access protected + * + * @param string $which */ protected function pagination( $which ) { if ( empty( $this->_pagination_args ) ) { @@ -929,6 +937,7 @@ class WP_List_Table { * * @since 3.1.0 * @access protected + * @param string $which */ protected function display_tablenav( $which ) { if ( 'top' == $which ) @@ -954,6 +963,8 @@ class WP_List_Table { * * @since 3.1.0 * @access protected + * + * @param string $which */ protected function extra_tablenav( $which ) {} diff --git a/wp-admin/includes/class-wp-media-list-table.php b/wp-admin/includes/class-wp-media-list-table.php index e88b3b977b..182f3ec315 100644 --- a/wp-admin/includes/class-wp-media-list-table.php +++ b/wp-admin/includes/class-wp-media-list-table.php @@ -104,6 +104,9 @@ class WP_Media_List_Table extends WP_List_Table { return $actions; } + /** + * @param string $which + */ protected function extra_tablenav( $which ) { if ( 'bar' !== $which ) { return; @@ -146,9 +149,10 @@ class WP_Media_List_Table extends WP_List_Table { _e( 'No media attachments found.' ); } + /** + * @param string $which + */ protected function pagination( $which ) { - global $mode; - parent::pagination( $which ); } @@ -493,6 +497,10 @@ foreach ( $columns as $column_name => $column_display_name ) { single_row( $theme ); } + /** + * @global string $status + * @global int $page + * @global string $s + * @global array $totals + * @param WP_Theme $theme + */ public function single_row( $theme ) { global $status, $page, $s, $totals; diff --git a/wp-admin/includes/class-wp-ms-users-list-table.php b/wp-admin/includes/class-wp-ms-users-list-table.php index 78f8f327d1..3a8dd25259 100644 --- a/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/wp-admin/includes/class-wp-ms-users-list-table.php @@ -102,6 +102,10 @@ class WP_MS_Users_List_Table extends WP_List_Table { return $role_links; } + /** + * @global string $mode + * @param string $which + */ protected function pagination( $which ) { global $mode; diff --git a/wp-admin/includes/class-wp-plugin-install-list-table.php b/wp-admin/includes/class-wp-plugin-install-list-table.php index 27c053d6e3..bbdb745d90 100644 --- a/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -268,6 +268,9 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { $this->display_tablenav( 'bottom' ); } + /** + * @param string $which + */ protected function display_tablenav( $which ) { if ( $GLOBALS['tab'] === 'featured' ) { return; @@ -306,6 +309,11 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { return array(); } + /** + * @param object $plugin_a + * @param object $plugin_b + * @return int + */ private function order_callback( $plugin_a, $plugin_b ) { $orderby = $this->orderby; if ( ! isset( $plugin_a->$orderby, $plugin_b->$orderby ) ) { diff --git a/wp-admin/includes/class-wp-plugins-list-table.php b/wp-admin/includes/class-wp-plugins-list-table.php index 5d04c96411..1ade73caac 100644 --- a/wp-admin/includes/class-wp-plugins-list-table.php +++ b/wp-admin/includes/class-wp-plugins-list-table.php @@ -191,6 +191,11 @@ class WP_Plugins_List_Table extends WP_List_Table { ) ); } + /** + * @staticvar string $term + * @param array $plugin + * @return boolean + */ public function _search_callback( $plugin ) { static $term; if ( is_null( $term ) ) @@ -205,6 +210,13 @@ class WP_Plugins_List_Table extends WP_List_Table { return false; } + /** + * @global string $orderby + * @global string $order + * @param array $plugin_a + * @param array $plugin_b + * @return int + */ public function _order_callback( $plugin_a, $plugin_b ) { global $orderby, $order; @@ -308,6 +320,11 @@ class WP_Plugins_List_Table extends WP_List_Table { return $actions; } + /** + * @global string $status + * @param string $which + * @return null + */ public function bulk_actions( $which = '' ) { global $status; @@ -317,6 +334,11 @@ class WP_Plugins_List_Table extends WP_List_Table { parent::bulk_actions( $which ); } + /** + * @global string $status + * @param string $which + * @return null + */ protected function extra_tablenav( $which ) { global $status; @@ -352,6 +374,13 @@ class WP_Plugins_List_Table extends WP_List_Table { $this->single_row( array( $plugin_file, $plugin_data ) ); } + /** + * @global string $status + * @global int $page + * @global string $s + * @global array $totals + * @param array $item + */ public function single_row( $item ) { global $status, $page, $s, $totals; diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index a765eeecb0..76aa1e5b0b 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -217,6 +217,10 @@ class WP_Posts_List_Table extends WP_List_Table { return $actions; } + /** + * @global int $cat + * @param string $which + */ protected function extra_tablenav( $which ) { global $cat; ?> @@ -268,6 +272,10 @@ class WP_Posts_List_Table extends WP_List_Table { return parent::current_action(); } + /** + * @global string $mode + * @param string $which + */ protected function pagination( $which ) { global $mode; @@ -375,6 +383,12 @@ class WP_Posts_List_Table extends WP_List_Table { ); } + /** + * @global WP_Query $wp_query + * @global int $per_page + * @param array $posts + * @param int $level + */ public function display_rows( $posts = array(), $level = 0 ) { global $wp_query, $per_page; @@ -390,6 +404,11 @@ class WP_Posts_List_Table extends WP_List_Table { } } + /** + * @global string $mode + * @param array $posts + * @param int $level + */ private function _display_rows( $posts, $level = 0 ) { global $mode; @@ -405,6 +424,13 @@ class WP_Posts_List_Table extends WP_List_Table { $this->single_row( $post, $level ); } + /** + * @global wpdb $wpdb + * @param array $pages + * @param int $pagenum + * @param int $per_page + * @return bool|null + */ private function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) { global $wpdb; @@ -542,6 +568,12 @@ class WP_Posts_List_Table extends WP_List_Table { unset( $children_pages[$parent] ); //required in order to keep track of orphans } + /** + * @global string $mode + * @staticvar string $alternate + * @param WP_Post $post + * @param int $level + */ public function single_row( $post, $level = 0 ) { global $mode; static $alternate; diff --git a/wp-admin/includes/class-wp-terms-list-table.php b/wp-admin/includes/class-wp-terms-list-table.php index 9e3efa1b84..1916b5ac03 100644 --- a/wp-admin/includes/class-wp-terms-list-table.php +++ b/wp-admin/includes/class-wp-terms-list-table.php @@ -202,6 +202,16 @@ class WP_Terms_List_Table extends WP_List_Table { } } + /** + * @param string $taxonomy + * @param array $terms + * @param array $children + * @param int $start + * @param int $per_page + * @param int $count + * @param int $parent + * @param int $level + */ private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) { $end = $start + $per_page; @@ -250,6 +260,12 @@ class WP_Terms_List_Table extends WP_List_Table { } } + /** + * @global string $taxonomy + * @staticvar string $row_class + * @param object $tag + * @param int $level + */ public function single_row( $tag, $level = 0 ) { global $taxonomy; $tag = sanitize_term( $tag, $taxonomy ); @@ -264,6 +280,10 @@ class WP_Terms_List_Table extends WP_List_Table { echo ''; } + /** + * @param object $tag + * @return string + */ public function column_cb( $tag ) { $default_term = get_option( 'default_' . $this->screen->taxonomy ); @@ -274,6 +294,10 @@ class WP_Terms_List_Table extends WP_List_Table { return ' '; } + /** + * @param object $tag + * @return string + */ public function column_name( $tag ) { $taxonomy = $this->screen->taxonomy; $tax = get_taxonomy( $taxonomy ); @@ -348,15 +372,27 @@ class WP_Terms_List_Table extends WP_List_Table { return $out; } + /** + * @param object $tag + * @return string + */ public function column_description( $tag ) { return $tag->description; } + /** + * @param object $tag + * @return string + */ public function column_slug( $tag ) { /** This filter is documented in wp-admin/edit-tag-form.php */ return apply_filters( 'editable_slug', $tag->slug ); } + /** + * @param object $tag + * @return string + */ public function column_posts( $tag ) { $count = number_format_i18n( $tag->count ); @@ -381,6 +417,10 @@ class WP_Terms_List_Table extends WP_List_Table { return "$count"; } + /** + * @param object $tag + * @return string + */ public function column_links( $tag ) { $count = number_format_i18n( $tag->count ); if ( $count ) @@ -388,6 +428,11 @@ class WP_Terms_List_Table extends WP_List_Table { return $count; } + /** + * @param object $tag + * @param string $column_name + * @return string + */ public function column_default( $tag, $column_name ) { /** * Filter the displayed columns in the terms list table. diff --git a/wp-admin/includes/class-wp-themes-list-table.php b/wp-admin/includes/class-wp-themes-list-table.php index fcc5ebd905..6311e7554c 100644 --- a/wp-admin/includes/class-wp-themes-list-table.php +++ b/wp-admin/includes/class-wp-themes-list-table.php @@ -95,6 +95,10 @@ class WP_Themes_List_Table extends WP_List_Table { printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) ); } + /** + * @param string $which + * @return null + */ public function tablenav( $which = 'top' ) { if ( $this->get_pagination_arg( 'total_pages' ) <= 1 ) return; @@ -219,6 +223,10 @@ class WP_Themes_List_Table extends WP_List_Table { endforeach; } + /** + * @param WP_Theme $theme + * @return bool + */ public function search_theme( $theme ) { // Search the features foreach ( $this->features as $word ) { @@ -255,6 +263,8 @@ class WP_Themes_List_Table extends WP_List_Table { * * @since 3.4.0 * @access public + * + * @param array $extra_args */ public function _js_vars( $extra_args = array() ) { $search_string = isset( $_REQUEST['s'] ) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : ''; diff --git a/wp-includes/version.php b/wp-includes/version.php index 75f5031f61..7efe47cb9f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-beta2-30678'; +$wp_version = '4.1-beta2-30679'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.