Make WordPress Core

Changeset 47059


Ignore:
Timestamp:
01/11/2020 05:56:15 PM (5 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src/wp-admin/includes
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-comments-list-table.php

    r46391 r47059  
    577577     * @param string     $column_name Current column name.
    578578     * @param string     $primary     Primary column name.
    579      * @return string|void Comment row actions output.
     579     * @return string Row actions output for comments. An empty string
     580     *                if the current column is not the primary column,
     581     *                or if the current user cannot edit the comment.
    580582     */
    581583    protected function handle_row_actions( $comment, $column_name, $primary ) {
     
    587589
    588590        if ( ! $this->user_can ) {
    589             return;
     591            return '';
    590592        }
    591593
  • trunk/src/wp-admin/includes/class-wp-links-list-table.php

    r46316 r47059  
    315315     * @param string $column_name Current column name.
    316316     * @param string $primary     Primary column name.
    317      * @return string Row action output for links.
     317     * @return string Row actions output for links, or an empty string
     318     *                if the current column is not the primary column.
    318319     */
    319320    protected function handle_row_actions( $link, $column_name, $primary ) {
  • trunk/src/wp-admin/includes/class-wp-media-list-table.php

    r46578 r47059  
    782782     * @param string $column_name Current column name.
    783783     * @param string $primary     Primary column name.
    784      * @return string Row actions output for media attachments.
     784     * @return string Row actions output for media attachments, or an empty string
     785     *                if the current column is not the primary column.
    785786     */
    786787    protected function handle_row_actions( $post, $column_name, $primary ) {
     
    790791
    791792        $att_title = _draft_or_post_title();
     793
    792794        return $this->row_actions( $this->_get_row_actions( $post, $att_title ) );
    793795    }
  • trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php

    r46441 r47059  
    667667     * @param string $column_name Current column name.
    668668     * @param string $primary     Primary column name.
    669      * @return string Row actions output.
     669     * @return string Row actions output for sites in Multisite, or an empty string
     670     *                if the current column is not the primary column.
    670671     */
    671672    protected function handle_row_actions( $blog, $column_name, $primary ) {
    672673        if ( $primary !== $column_name ) {
    673             return;
     674            return '';
    674675        }
    675676
     
    734735         */
    735736        $actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );
     737
    736738        return $this->row_actions( $actions );
    737739    }
  • trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php

    r46596 r47059  
    489489     * @param string $column_name Current column name.
    490490     * @param string $primary     Primary column name.
    491      * @return string Row actions output for users in Multisite.
     491     * @return string Row actions output for users in Multisite, or an empty string
     492     *                if the current column is not the primary column.
    492493     */
    493494    protected function handle_row_actions( $user, $column_name, $primary ) {
     
    518519         */
    519520        $actions = apply_filters( 'ms_user_row_actions', $actions, $user );
     521
    520522        return $this->row_actions( $actions );
    521523    }
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r46596 r47059  
    13211321     * @param string $column_name Current column name.
    13221322     * @param string $primary     Primary column name.
    1323      * @return string Row actions output for posts.
     1323     * @return string Row actions output for posts, or an empty string
     1324     *                if the current column is not the primary column.
    13241325     */
    13251326    protected function handle_row_actions( $post, $column_name, $primary ) {
  • trunk/src/wp-admin/includes/class-wp-terms-list-table.php

    r46685 r47059  
    447447     * @param string  $column_name Current column name.
    448448     * @param string  $primary     Primary column name.
    449      * @return string Row actions output for terms.
     449     * @return string Row actions output for terms, or an empty string
     450     *                if the current column is not the primary column.
    450451     */
    451452    protected function handle_row_actions( $tag, $column_name, $primary ) {
Note: See TracChangeset for help on using the changeset viewer.