Users: Pass the array of user IDs being deleted to the `delete_user_form` action hook in two places.

Also updates documentation for the first parameter, `$current_user`, to clarify that it holds the `WP_User` object for the _current_ user, not the one being deleted.

Props usermrpapa.
Fixes #35063. 

Built from https://develop.svn.wordpress.org/trunk@36640


git-svn-id: http://core.svn.wordpress.org/trunk@36607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2016-02-23 17:42:27 +00:00
parent 0485352508
commit 54ab5fa68c
3 changed files with 6 additions and 4 deletions

View File

@ -1088,7 +1088,7 @@ function confirm_delete_users( $users ) {
</table> </table>
<?php <?php
/** This action is documented in wp-admin/users.php */ /** This action is documented in wp-admin/users.php */
do_action( 'delete_user_form', $current_user ); do_action( 'delete_user_form', $current_user, $allusers );
if ( 1 == count( $users ) ) : ?> if ( 1 == count( $users ) ) : ?>
<p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, the user will be permanently removed.' ); ?></p> <p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, the user will be permanently removed.' ); ?></p>

View File

@ -284,10 +284,12 @@ case 'delete':
* Fires at the end of the delete users form prior to the confirm button. * Fires at the end of the delete users form prior to the confirm button.
* *
* @since 4.0.0 * @since 4.0.0
* @since 4.5.0 The `$userids` parameter was added.
* *
* @param WP_User $current_user WP_User object for the user being deleted. * @param WP_User $current_user WP_User object for the current user.
* @param array $userids Array of IDs for users being deleted.
*/ */
do_action( 'delete_user_form', $current_user ); do_action( 'delete_user_form', $current_user, $userids );
?> ?>
<input type="hidden" name="action" value="dodelete" /> <input type="hidden" name="action" value="dodelete" />
<?php submit_button( __('Confirm Deletion'), 'primary' ); ?> <?php submit_button( __('Confirm Deletion'), 'primary' ); ?>

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.5-alpha-36639'; $wp_version = '4.5-alpha-36640';
/** /**
* 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.