Docs: Synchronize `@return` descriptions for `::handle_row_actions()` methods in list tables.

Make sure `WP_Comments_List_Table::handle_row_actions()` and `WP_MS_Sites_List_Table::handle_row_actions()` return a string, for consistency with other classes.

See #49170, #48303.
Built from https://develop.svn.wordpress.org/trunk@47059


git-svn-id: http://core.svn.wordpress.org/trunk@46859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-01-11 17:59:04 +00:00
parent d469aa8162
commit 2294d65753
8 changed files with 21 additions and 10 deletions

View File

@ -576,7 +576,9 @@ class WP_Comments_List_Table extends WP_List_Table {
* @param WP_Comment $comment The comment object.
* @param string $column_name Current column name.
* @param string $primary Primary column name.
* @return string|void Comment row actions output.
* @return string Row actions output for comments. An empty string
* if the current column is not the primary column,
* or if the current user cannot edit the comment.
*/
protected function handle_row_actions( $comment, $column_name, $primary ) {
global $comment_status;
@ -586,7 +588,7 @@ class WP_Comments_List_Table extends WP_List_Table {
}
if ( ! $this->user_can ) {
return;
return '';
}
$the_comment_status = wp_get_comment_status( $comment );

View File

@ -314,7 +314,8 @@ class WP_Links_List_Table extends WP_List_Table {
* @param object $link Link being acted upon.
* @param string $column_name Current column name.
* @param string $primary Primary column name.
* @return string Row action output for links.
* @return string Row actions output for links, or an empty string
* if the current column is not the primary column.
*/
protected function handle_row_actions( $link, $column_name, $primary ) {
if ( $primary !== $column_name ) {

View File

@ -781,7 +781,8 @@ class WP_Media_List_Table extends WP_List_Table {
* @param object $post Attachment being acted upon.
* @param string $column_name Current column name.
* @param string $primary Primary column name.
* @return string Row actions output for media attachments.
* @return string Row actions output for media attachments, or an empty string
* if the current column is not the primary column.
*/
protected function handle_row_actions( $post, $column_name, $primary ) {
if ( $primary !== $column_name ) {
@ -789,6 +790,7 @@ class WP_Media_List_Table extends WP_List_Table {
}
$att_title = _draft_or_post_title();
return $this->row_actions( $this->_get_row_actions( $post, $att_title ) );
}
}

View File

@ -666,11 +666,12 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
* @param object $blog Site being acted upon.
* @param string $column_name Current column name.
* @param string $primary Primary column name.
* @return string Row actions output.
* @return string Row actions output for sites in Multisite, or an empty string
* if the current column is not the primary column.
*/
protected function handle_row_actions( $blog, $column_name, $primary ) {
if ( $primary !== $column_name ) {
return;
return '';
}
$blogname = untrailingslashit( $blog['domain'] . $blog['path'] );
@ -733,6 +734,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
* or subdirectory multisite installation.
*/
$actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );
return $this->row_actions( $actions );
}
}

View File

@ -488,7 +488,8 @@ class WP_MS_Users_List_Table extends WP_List_Table {
* @param object $user User being acted upon.
* @param string $column_name Current column name.
* @param string $primary Primary column name.
* @return string Row actions output for users in Multisite.
* @return string Row actions output for users in Multisite, or an empty string
* if the current column is not the primary column.
*/
protected function handle_row_actions( $user, $column_name, $primary ) {
if ( $primary !== $column_name ) {
@ -517,6 +518,7 @@ class WP_MS_Users_List_Table extends WP_List_Table {
* @param WP_User $user WP_User object.
*/
$actions = apply_filters( 'ms_user_row_actions', $actions, $user );
return $this->row_actions( $actions );
}
}

View File

@ -1320,7 +1320,8 @@ class WP_Posts_List_Table extends WP_List_Table {
* @param object $post Post being acted upon.
* @param string $column_name Current column name.
* @param string $primary Primary column name.
* @return string Row actions output for posts.
* @return string Row actions output for posts, or an empty string
* if the current column is not the primary column.
*/
protected function handle_row_actions( $post, $column_name, $primary ) {
if ( $primary !== $column_name ) {

View File

@ -446,7 +446,8 @@ class WP_Terms_List_Table extends WP_List_Table {
* @param WP_Term $tag Tag being acted upon.
* @param string $column_name Current column name.
* @param string $primary Primary column name.
* @return string Row actions output for terms.
* @return string Row actions output for terms, or an empty string
* if the current column is not the primary column.
*/
protected function handle_row_actions( $tag, $column_name, $primary ) {
if ( $primary !== $column_name ) {

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.4-alpha-47058';
$wp_version = '5.4-alpha-47059';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.