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
This commit is contained in:
Scott Taylor 2014-12-01 00:33:23 +00:00
parent da4c39480f
commit 65ab522a51
11 changed files with 172 additions and 3 deletions

View File

@ -479,6 +479,8 @@ class WP_List_Table {
* *
* @since 3.1.0 * @since 3.1.0
* @access protected * @access protected
*
* @param string $post_type
*/ */
protected function months_dropdown( $post_type ) { protected function months_dropdown( $post_type ) {
global $wpdb, $wp_locale; global $wpdb, $wp_locale;
@ -535,6 +537,8 @@ class WP_List_Table {
* *
* @since 3.1.0 * @since 3.1.0
* @access protected * @access protected
*
* @param string $current_mode
*/ */
protected function view_switcher( $current_mode ) { protected function view_switcher( $current_mode ) {
?> ?>
@ -601,6 +605,8 @@ class WP_List_Table {
* @since 3.1.0 * @since 3.1.0
* @access protected * @access protected
* *
* @param string $option
* @param int $default
* @return int * @return int
*/ */
protected function get_items_per_page( $option, $default = 20 ) { protected function get_items_per_page( $option, $default = 20 ) {
@ -629,6 +635,8 @@ class WP_List_Table {
* *
* @since 3.1.0 * @since 3.1.0
* @access protected * @access protected
*
* @param string $which
*/ */
protected function pagination( $which ) { protected function pagination( $which ) {
if ( empty( $this->_pagination_args ) ) { if ( empty( $this->_pagination_args ) ) {
@ -929,6 +937,7 @@ class WP_List_Table {
* *
* @since 3.1.0 * @since 3.1.0
* @access protected * @access protected
* @param string $which
*/ */
protected function display_tablenav( $which ) { protected function display_tablenav( $which ) {
if ( 'top' == $which ) if ( 'top' == $which )
@ -954,6 +963,8 @@ class WP_List_Table {
* *
* @since 3.1.0 * @since 3.1.0
* @access protected * @access protected
*
* @param string $which
*/ */
protected function extra_tablenav( $which ) {} protected function extra_tablenav( $which ) {}

View File

@ -104,6 +104,9 @@ class WP_Media_List_Table extends WP_List_Table {
return $actions; return $actions;
} }
/**
* @param string $which
*/
protected function extra_tablenav( $which ) { protected function extra_tablenav( $which ) {
if ( 'bar' !== $which ) { if ( 'bar' !== $which ) {
return; return;
@ -146,9 +149,10 @@ class WP_Media_List_Table extends WP_List_Table {
_e( 'No media attachments found.' ); _e( 'No media attachments found.' );
} }
/**
* @param string $which
*/
protected function pagination( $which ) { protected function pagination( $which ) {
global $mode;
parent::pagination( $which ); parent::pagination( $which );
} }
@ -493,6 +497,10 @@ foreach ( $columns as $column_name => $column_display_name ) {
<?php endwhile; <?php endwhile;
} }
/**
* @param WP_Post $post
* @param string $att_title
*/
private function _get_row_actions( $post, $att_title ) { private function _get_row_actions( $post, $att_title ) {
$actions = array(); $actions = array();

View File

@ -146,6 +146,9 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
return $actions; return $actions;
} }
/**
* @param string $which
*/
protected function pagination( $which ) { protected function pagination( $which ) {
global $mode; global $mode;

View File

@ -142,6 +142,11 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
) ); ) );
} }
/**
* @staticvar string $term
* @param WP_Theme $theme
* @return bool
*/
public function _search_callback( $theme ) { public function _search_callback( $theme ) {
static $term; static $term;
if ( is_null( $term ) ) if ( is_null( $term ) )
@ -163,6 +168,13 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
} }
// Not used by any core columns. // Not used by any core columns.
/**
* @global string $orderby
* @global string $order
* @param array $theme_a
* @param array $theme_b
* @return int
*/
public function _order_callback( $theme_a, $theme_b ) { public function _order_callback( $theme_a, $theme_b ) {
global $orderby, $order; global $orderby, $order;
@ -266,6 +278,13 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
$this->single_row( $theme ); $this->single_row( $theme );
} }
/**
* @global string $status
* @global int $page
* @global string $s
* @global array $totals
* @param WP_Theme $theme
*/
public function single_row( $theme ) { public function single_row( $theme ) {
global $status, $page, $s, $totals; global $status, $page, $s, $totals;

View File

@ -102,6 +102,10 @@ class WP_MS_Users_List_Table extends WP_List_Table {
return $role_links; return $role_links;
} }
/**
* @global string $mode
* @param string $which
*/
protected function pagination( $which ) { protected function pagination( $which ) {
global $mode; global $mode;

View File

@ -268,6 +268,9 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
$this->display_tablenav( 'bottom' ); $this->display_tablenav( 'bottom' );
} }
/**
* @param string $which
*/
protected function display_tablenav( $which ) { protected function display_tablenav( $which ) {
if ( $GLOBALS['tab'] === 'featured' ) { if ( $GLOBALS['tab'] === 'featured' ) {
return; return;
@ -306,6 +309,11 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
return array(); return array();
} }
/**
* @param object $plugin_a
* @param object $plugin_b
* @return int
*/
private function order_callback( $plugin_a, $plugin_b ) { private function order_callback( $plugin_a, $plugin_b ) {
$orderby = $this->orderby; $orderby = $this->orderby;
if ( ! isset( $plugin_a->$orderby, $plugin_b->$orderby ) ) { if ( ! isset( $plugin_a->$orderby, $plugin_b->$orderby ) ) {

View File

@ -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 ) { public function _search_callback( $plugin ) {
static $term; static $term;
if ( is_null( $term ) ) if ( is_null( $term ) )
@ -205,6 +210,13 @@ class WP_Plugins_List_Table extends WP_List_Table {
return false; 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 ) { public function _order_callback( $plugin_a, $plugin_b ) {
global $orderby, $order; global $orderby, $order;
@ -308,6 +320,11 @@ class WP_Plugins_List_Table extends WP_List_Table {
return $actions; return $actions;
} }
/**
* @global string $status
* @param string $which
* @return null
*/
public function bulk_actions( $which = '' ) { public function bulk_actions( $which = '' ) {
global $status; global $status;
@ -317,6 +334,11 @@ class WP_Plugins_List_Table extends WP_List_Table {
parent::bulk_actions( $which ); parent::bulk_actions( $which );
} }
/**
* @global string $status
* @param string $which
* @return null
*/
protected function extra_tablenav( $which ) { protected function extra_tablenav( $which ) {
global $status; global $status;
@ -352,6 +374,13 @@ class WP_Plugins_List_Table extends WP_List_Table {
$this->single_row( array( $plugin_file, $plugin_data ) ); $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 ) { public function single_row( $item ) {
global $status, $page, $s, $totals; global $status, $page, $s, $totals;

View File

@ -217,6 +217,10 @@ class WP_Posts_List_Table extends WP_List_Table {
return $actions; return $actions;
} }
/**
* @global int $cat
* @param string $which
*/
protected function extra_tablenav( $which ) { protected function extra_tablenav( $which ) {
global $cat; global $cat;
?> ?>
@ -268,6 +272,10 @@ class WP_Posts_List_Table extends WP_List_Table {
return parent::current_action(); return parent::current_action();
} }
/**
* @global string $mode
* @param string $which
*/
protected function pagination( $which ) { protected function pagination( $which ) {
global $mode; 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 ) { public function display_rows( $posts = array(), $level = 0 ) {
global $wp_query, $per_page; 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 ) { private function _display_rows( $posts, $level = 0 ) {
global $mode; global $mode;
@ -405,6 +424,13 @@ class WP_Posts_List_Table extends WP_List_Table {
$this->single_row( $post, $level ); $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 ) { private function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) {
global $wpdb; 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 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 ) { public function single_row( $post, $level = 0 ) {
global $mode; global $mode;
static $alternate; static $alternate;

View File

@ -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 ) { private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) {
$end = $start + $per_page; $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 ) { public function single_row( $tag, $level = 0 ) {
global $taxonomy; global $taxonomy;
$tag = sanitize_term( $tag, $taxonomy ); $tag = sanitize_term( $tag, $taxonomy );
@ -264,6 +280,10 @@ class WP_Terms_List_Table extends WP_List_Table {
echo '</tr>'; echo '</tr>';
} }
/**
* @param object $tag
* @return string
*/
public function column_cb( $tag ) { public function column_cb( $tag ) {
$default_term = get_option( 'default_' . $this->screen->taxonomy ); $default_term = get_option( 'default_' . $this->screen->taxonomy );
@ -274,6 +294,10 @@ class WP_Terms_List_Table extends WP_List_Table {
return '&nbsp;'; return '&nbsp;';
} }
/**
* @param object $tag
* @return string
*/
public function column_name( $tag ) { public function column_name( $tag ) {
$taxonomy = $this->screen->taxonomy; $taxonomy = $this->screen->taxonomy;
$tax = get_taxonomy( $taxonomy ); $tax = get_taxonomy( $taxonomy );
@ -348,15 +372,27 @@ class WP_Terms_List_Table extends WP_List_Table {
return $out; return $out;
} }
/**
* @param object $tag
* @return string
*/
public function column_description( $tag ) { public function column_description( $tag ) {
return $tag->description; return $tag->description;
} }
/**
* @param object $tag
* @return string
*/
public function column_slug( $tag ) { public function column_slug( $tag ) {
/** This filter is documented in wp-admin/edit-tag-form.php */ /** This filter is documented in wp-admin/edit-tag-form.php */
return apply_filters( 'editable_slug', $tag->slug ); return apply_filters( 'editable_slug', $tag->slug );
} }
/**
* @param object $tag
* @return string
*/
public function column_posts( $tag ) { public function column_posts( $tag ) {
$count = number_format_i18n( $tag->count ); $count = number_format_i18n( $tag->count );
@ -381,6 +417,10 @@ class WP_Terms_List_Table extends WP_List_Table {
return "<a href='" . esc_url ( add_query_arg( $args, 'edit.php' ) ) . "'>$count</a>"; return "<a href='" . esc_url ( add_query_arg( $args, 'edit.php' ) ) . "'>$count</a>";
} }
/**
* @param object $tag
* @return string
*/
public function column_links( $tag ) { public function column_links( $tag ) {
$count = number_format_i18n( $tag->count ); $count = number_format_i18n( $tag->count );
if ( $count ) if ( $count )
@ -388,6 +428,11 @@ class WP_Terms_List_Table extends WP_List_Table {
return $count; return $count;
} }
/**
* @param object $tag
* @param string $column_name
* @return string
*/
public function column_default( $tag, $column_name ) { public function column_default( $tag, $column_name ) {
/** /**
* Filter the displayed columns in the terms list table. * Filter the displayed columns in the terms list table.

View File

@ -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' ) ); 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' ) { public function tablenav( $which = 'top' ) {
if ( $this->get_pagination_arg( 'total_pages' ) <= 1 ) if ( $this->get_pagination_arg( 'total_pages' ) <= 1 )
return; return;
@ -219,6 +223,10 @@ class WP_Themes_List_Table extends WP_List_Table {
endforeach; endforeach;
} }
/**
* @param WP_Theme $theme
* @return bool
*/
public function search_theme( $theme ) { public function search_theme( $theme ) {
// Search the features // Search the features
foreach ( $this->features as $word ) { foreach ( $this->features as $word ) {
@ -255,6 +263,8 @@ class WP_Themes_List_Table extends WP_List_Table {
* *
* @since 3.4.0 * @since 3.4.0
* @access public * @access public
*
* @param array $extra_args
*/ */
public function _js_vars( $extra_args = array() ) { public function _js_vars( $extra_args = array() ) {
$search_string = isset( $_REQUEST['s'] ) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : ''; $search_string = isset( $_REQUEST['s'] ) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : '';

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.