Make WordPress Core

Opened 21 months ago

Closed 19 months ago

Last modified 19 months ago

#53992 closed enhancement (fixed)

Lets add WP_User object to "registration_redirect" filter

Reported by: collizo4sky's profile Collizo4sky Owned by: davidbaumwald's profile davidbaumwald
Milestone: 5.9 Priority: normal
Severity: normal Version:
Component: Login and Registration Keywords: has-patch commit
Focuses: Cc:

Description

I am the maintainer of Peters login redirect plugin. One of the most request feature is to redirect users after registration based on certain user characteristics.

Please, I want

$redirect_to = apply_filters( 'registration_redirect', $registration_redirect );

To change to

$redirect_to = apply_filters( 'registration_redirect', $registration_redirect, $errors );

Attachments (2)

53992.patch (696 bytes) - added by aadilali 21 months ago.
I have crated the patch for this.
53992-alt.patch (811 bytes) - added by aadilali 21 months ago.
Patch with @since note

Download all attachments as: .zip

Change History (18)

#1 @mukesh27
21 months ago

  • Component changed from General to Login and Registration

#2 @mukesh27
21 months ago

  • Keywords needs-patch added

Hi there!

If we add new argument then we also need to add document for it. Also i think we have to change that $errors variable with proper name so other don't get confuse.

#3 @Collizo4sky
21 months ago

@mukesh27 totally agreed. Currently away from my computer.

If you can submit a patch, that would be great.

#4 @SergeyBiryukov
21 months ago

  • Milestone changed from Awaiting Review to 5.9

@aadilali
21 months ago

I have crated the patch for this.

#5 @aadilali
21 months ago

  • Keywords has-patch needs-testing added; needs-patch removed
  • Resolution set to invalid
  • Status changed from new to closed

Hi,

Patch has been added but it need testing.

#6 @aadilali
21 months ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

#7 follow-up: @mukesh27
21 months ago

@aadilali thanks for the patch.

I think we have to add a @since note for the new filter parameter

Last edited 21 months ago by mukesh27 (previous) (diff)

#8 in reply to: ↑ 7 @aadilali
21 months ago

Replying to mukesh27:

@aadilali thanks for the patch.

I think we have to add a @since note new filter parameter

Should I add @since note and update the patch?

@aadilali
21 months ago

Patch with @since note

This ticket was mentioned in Slack in #core-test by hellofromtonya. View the logs.


19 months ago

#10 @hellofromTonya
19 months ago

  • Keywords needs-testing removed

This patch is not changing redirection functionality. Rather, it's passing the errors to hooked callbacks. In today's test scrub, it was determined that manual testing is not needed. Why? apply_filters() is well tested and the passing of another variable/data item is known to work.

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


19 months ago

#13 @audrasjb
19 months ago

  • Keywords commit added

Patch refreshed in the PR above. Tests are passing well.
Marking for commit.

#14 @davidbaumwald
19 months ago

  • Owner set to davidbaumwald
  • Status changed from reopened to reviewing

#15 @davidbaumwald
19 months ago

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

In 52091:

Login and Registration: Pass $errors parameter to registration_redirect filter.

On user registration, the $errors variable is the result of register_new_user which contains either the newly registered user's ID on success or a WP_Error object on failure. This change passes that context to the registration_redirect filter.

Props Collizo4sky, aadilali, mukesh27, audrasjb.
Fixes #53992.

Note: See TracTickets for help on using tickets.