Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#23057 closed enhancement (fixed)

Pass $reassign in the delete_user hook

Reported by: genkisan's profile genkisan Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.5
Component: Users Keywords: has-patch commit
Focuses: Cc:

Description

File: wp-admin\includes\user.php

In the wp_delete_user function, there are 2 do_action hooks

  • do_action('delete_user', $id);
  • do_action('deleted_user', $id);

The $reassign variable should also be passed along. We can then decide what to do when the admin delete a user by "Delete all posts" or "Attribute all posts to: XYZ".

Attachments (3)

user.php (13.3 KB) - added by genkisan 12 years ago.
user.php.patch (593 bytes) - added by genkisan 12 years ago.
23057.patch (990 bytes) - added by SergeyBiryukov 11 years ago.
Refreshed, added docs

Download all attachments as: .zip

Change History (11)

@genkisan
12 years ago

#1 @SergeyBiryukov
12 years ago

  • Keywords has-patch removed
  • Type changed from defect (bug) to enhancement

You can submit an actual patch rather than the entire file.

Please take a look at http://make.wordpress.org/core/handbook/submitting-a-patch/.

@genkisan
12 years ago

#2 @genkisan
12 years ago

  • Keywords has-patch added

Oops. Patch submitted.

#3 @danielbachhuber
11 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 3.9

This would be useful to me too. Co-Authors Plus is currently depending on the $_POST variable.

@SergeyBiryukov
11 years ago

Refreshed, added docs

#4 @SergeyBiryukov
11 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 27462:

Pass $reassign parameter to 'delete_user' and 'deleted_user' actions.

props genkisan.
fixes #23057.

#5 @SergeyBiryukov
11 years ago

In 27463:

Fix docblock formatting in [27462]. see #23057.

#6 @nacin
11 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Gonna make a few adjustments to this. I'd like to normalize $reassign which can be 'novalue' or null. Let's normalize it to null for the purposes of the hook.

#7 @nacin
11 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 27466:

Normalize $reassign in wp_delete_user() to ensure the hooks receive consistent values.

fixes #23057.

#8 @nacin
11 years ago

In 27467:

Remove lame debugging. see #23057.

Note: See TracTickets for help on using tickets.