[wp-trac] [WordPress Trac] #61746: WordPress login redirect issue

WordPress Trac noreply at wordpress.org
Fri Oct 4 15:59:58 UTC 2024


#61746: WordPress login redirect issue
------------------------------------+------------------------------
 Reporter:  dipakparmar2007         |       Owner:  (none)
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Login and Registration  |     Version:  6.6.1
 Severity:  normal                  |  Resolution:
 Keywords:  has-testing-info        |     Focuses:
------------------------------------+------------------------------
Changes (by hellofromTonya):

 * keywords:   => has-testing-info
 * component:  General => Login and Registration
 * severity:  critical => normal


Comment:

 == Testing Instructions
 These steps define how to reproduce the issue and indicate the expected
 behavior.

 === Steps to Reproduce or Test

 Test Page: Dashboard.

 1. Create the "Dashboard" page.
    * Log into WordPress.
    * Go to Pages > Add New Page.
    * Add "Dashboard" as the title.
    * Publish the page.
 2. Log out of the site.
 3. Add the test code as a must-use plugin:

    * Add the `wp-content/mu-plugins/` directory.
    * Add a `test.php` file in that directory.
    * Copy and paste the following code into that file:

 {{{#!php
 add_filter( 'login_redirect', 'custom_login_redirect', 10, 3 );
 function custom_login_redirect( $redirect_to, $request, $user ) {
         return home_url('/dashboard/');
 }
 }}}
    * Save the file.

 4. Go to the login page, e.g. `http://example.com/wp-admin/` or
 `http://example.com/wp-login.php`.
 5. Enter your login credentials.
 6. Select/trigger/enter the Log In button.
 7. 🐞 Bug occurs.

 === Expected Results

 When testing a patch to validate it works as expected:
 - ✅ Should redirect to the expected page after login.

 When reproducing a bug:
 - ❌ Does not redirect to the expected page after login.

 === Supplemental Artifacts

   **Test Report Icons:**
   🐞 <= Indicates where issue ("bug") occurs.
   ✅ <= Behavior is ''expected''.
   ❌ <= Behavior is ''NOT expected''.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61746#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list