Make WordPress Core

Changeset 46811


Ignore:
Timestamp:
12/03/2019 01:56:25 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Docs: Move the canonical DocBlock for handle_bulk_actions-{$screen} action to wp-admin/edit.php.

  • Document accepted values for the $items parameter.
  • Use interpolated syntax for the filter name.

Props dilipbheda, johnbillion, SergeyBiryukov.
Fixes #48857.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-comments.php

    r45932 r46811  
    9393                $screen = get_current_screen()->id;
    9494
    95                 /**
    96                  * Fires when a custom bulk action should be handled.
    97                  *
    98                  * The redirect link should be modified with success or failure feedback
    99                  * from the action to be used to display feedback to the user.
    100                  *
    101                  * The dynamic portion of the hook name, `$screen`, refers to the current screen ID.
    102                  *
    103                  * @since 4.7.0
    104                  *
    105                  * @param string $redirect_url The redirect URL.
    106                  * @param string $doaction     The action being taken.
    107                  * @param array  $items        The items to take the action on.
    108                  */
     95                /** This action is documented in wp-admin/edit.php */
    10996                $redirect_to = apply_filters( "handle_bulk_actions-{$screen}", $redirect_to, $doaction, $comment_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    11097        }
  • trunk/src/wp-admin/edit-tags.php

    r46685 r46811  
    200200                }
    201201                check_admin_referer( 'bulk-tags' );
    202                 $tags = (array) $_REQUEST['delete_tags'];
    203                 /** This action is documented in wp-admin/edit-comments.php */
    204                 $location = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $location, $wp_list_table->current_action(), $tags );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     202
     203                $screen = get_current_screen()->id;
     204                $tags   = (array) $_REQUEST['delete_tags'];
     205
     206                /** This action is documented in wp-admin/edit.php */
     207                $location = apply_filters( "handle_bulk_actions-{$screen}", $location, $wp_list_table->current_action(), $tags );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    205208                break;
    206209}
  • trunk/src/wp-admin/edit.php

    r45932 r46811  
    183183                        break;
    184184                default:
    185                         /** This action is documented in wp-admin/edit-comments.php */
    186                         $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $post_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     185                        $screen = get_current_screen()->id;
     186
     187                        /**
     188                         * Fires when a custom bulk action should be handled.
     189                         *
     190                         * The redirect link should be modified with success or failure feedback
     191                         * from the action to be used to display feedback to the user.
     192                         *
     193                         * The dynamic portion of the hook name, `$screen`, refers to the current screen ID.
     194                         *
     195                         * @since 4.7.0
     196                         *
     197                         * @param string $sendback The redirect URL.
     198                         * @param string $doaction The action being taken.
     199                         * @param array  $items    The items to take the action on. Accepts an array of IDs of posts,
     200                         *                         comments, terms, links, plugins, attachments, or users.
     201                         */
     202                        $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $doaction, $post_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    187203                        break;
    188204        }
  • trunk/src/wp-admin/link-manager.php

    r45932 r46811  
    3333                $redirect_to = add_query_arg( 'deleted', count( $bulklinks ), $redirect_to );
    3434        } else {
    35                 /** This action is documented in wp-admin/edit-comments.php */
    36                 $redirect_to = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $redirect_to, $doaction, $bulklinks ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     35                $screen = get_current_screen()->id;
     36
     37                /** This action is documented in wp-admin/edit.php */
     38                $redirect_to = apply_filters( "handle_bulk_actions-{$screen}", $redirect_to, $doaction, $bulklinks ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    3739        }
    3840        wp_redirect( $redirect_to );
  • trunk/src/wp-admin/plugins.php

    r45932 r46811  
    415415                        if ( isset( $_POST['checked'] ) ) {
    416416                                check_admin_referer( 'bulk-plugins' );
     417
     418                                $screen   = get_current_screen()->id;
     419                                $sendback = wp_get_referer();
    417420                                $plugins  = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();
    418                                 $sendback = wp_get_referer();
    419 
    420                                 /** This action is documented in wp-admin/edit-comments.php */
    421                                 $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $action, $plugins );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     421
     422                                /** This action is documented in wp-admin/edit.php */
     423                                $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $action, $plugins );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    422424                                wp_safe_redirect( $sendback );
    423425                                exit;
  • trunk/src/wp-admin/upload.php

    r45932 r46811  
    199199                        break;
    200200                default:
    201                         /** This action is documented in wp-admin/edit-comments.php */
    202                         $location = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $location, $doaction, $post_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     201                        $screen = get_current_screen()->id;
     202
     203                        /** This action is documented in wp-admin/edit.php */
     204                        $location = apply_filters( "handle_bulk_actions-{$screen}", $location, $doaction, $post_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    203205        }
    204206
  • trunk/src/wp-admin/users.php

    r45932 r46811  
    457457
    458458                if ( $wp_list_table->current_action() && ! empty( $_REQUEST['users'] ) ) {
     459                        $screen   = get_current_screen()->id;
     460                        $sendback = wp_get_referer();
    459461                        $userids  = $_REQUEST['users'];
    460                         $sendback = wp_get_referer();
    461 
    462                         /** This action is documented in wp-admin/edit-comments.php */
    463                         $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $wp_list_table->current_action(), $userids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     462
     463                        /** This action is documented in wp-admin/edit.php */
     464                        $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $wp_list_table->current_action(), $userids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    464465
    465466                        wp_safe_redirect( $sendback );
Note: See TracChangeset for help on using the changeset viewer.