Refactor wp_registration_url() to accept an optional redirect parameter#7725
Refactor wp_registration_url() to accept an optional redirect parameter#7725nirajgiriXD wants to merge 4 commits intoWordPress:trunkfrom
wp_registration_url() to accept an optional redirect parameter#7725Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
apermo
left a comment
There was a problem hiding this comment.
I suggest to rename $redirect to $redirect_to as this will be consistent with the url parameter.
And the change should be documented with a new @since in the phpdoc header.
Description
This PR adds an optional
$redirectparameter towp_registration_url(), enabling redirection after registration, similar to other WordPress URL functions. If a redirect URL is provided, it’s added as aredirect_toquery argument.Changes Made
Added
$redirectParameter:$redirectis provided, and if so, adds it as aredirect_toquery argument to the base registration URL.$register_urland includes the$redirectparameter in the filter hook, ensuring custom modifications to the registration URL also have access to this parameter.Testing Instruction
wp_registration_url()with and without a redirect parameter.redirect_toparameter when specified.Trac ticket: https://core.trac.wordpress.org/ticket/27632