Skip to content

Login/out: Add a custom login URL setting - #81865

Open
dhruvikpatel18 wants to merge 1 commit into
WordPress:trunkfrom
dhruvikpatel18:feat/custom-loginout-page-url
Open

Login/out: Add a custom login URL setting#81865
dhruvikpatel18 wants to merge 1 commit into
WordPress:trunkfrom
dhruvikpatel18:feat/custom-loginout-page-url

Conversation

@dhruvikpatel18

@dhruvikpatel18 dhruvikpatel18 commented Aug 20, 2026

Copy link
Copy Markdown
Member

What?

Closes #58234

Adds a loginUrl attribute to the Login/out block, so the log in link can point at a custom login page instead of wp-login.php.

Why?

The block currently hardcodes the default WordPress login page via wp_loginout(). Sites that use a membership plugin (or any plugin providing its own front-end login page) have no way to send visitors there from this block, and no way to keep the default login screen out of their navigation. Plugins used to fill this gap, but the issue reports they no longer work, so the option belongs in the block itself.

Testing Instructions

  1. Create a page to act as the custom login page (e.g. /sign-in/), or note the URL of one your login plugin provides.
  2. In the editor, insert a Login/out block into a template or post.
  3. Open the block's Settings panel in the inspector, click the options menu, and enable Custom login URL.
  4. Enter the URL from step 1. Leave Redirect to current URL enabled.
  5. Save, then view the page as a logged-out visitor (a private window is easiest).
  6. Confirm the "Log in" link points at your custom URL with ?redirect_to= set to the current page. Following it should land on your custom login page.
  7. Turn Redirect to current URL off and reload, the link should be the bare custom URL, with no redirect_to.
  8. Clear the Custom login URL field and reload, the link should return to the default wp-login.php.
  9. Log back in and reload, the "Log out" link should be unchanged and still work.
  10. With a custom URL set, enable Display login as form. The URL field is hidden, and a logged-out visitor sees the standard login form as before. Disabling the toggle brings the field back with its value intact.

Screenshots or screencast

Screen.Recording.2026-08-20.at.5.02.51.PM.mov

Use of AI Tools

This pull request was authored with help of Claude.

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Aug 20, 2026
@dhruvikpatel18
dhruvikpatel18 marked this pull request as ready for review August 21, 2026 06:22
@github-actions

Copy link
Copy Markdown

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 props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @parisambush.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: parisambush.

Co-authored-by: dhruvikpatel18 <dhruvik18@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Login/out Affects the Login/out Block labels Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Login/out Affects the Login/out Block [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom login page for login/logout block

2 participants