WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Add setting to allow access to registration page for non-logged-in users #375

@jeffpaul

Description

@jeffpaul

Is your enhancement related to a problem? Please describe.

Currently, when Restricted Site Access is enabled, all front-end pages including the user registration page are restricted based on the plugin’s access rules. This prevents new users from registering when the site is under restriction.

To improve flexibility, introduce a new setting (default: disabled) that allows administrators to permit access to the registration page (/wp-login.php?action=register or a custom registration URL) for any user who is not logged in.

Designs

Potential code snippet from @dkotter to consider:

add_filter(
	'restricted_site_access_is_restricted',
	function ( $is_restricted, $wp ) {
		if ( ! empty( $wp->request ) && 'wp-signup.php' === $wp->request ) {
			$is_restricted = false;
		}
		return $is_restricted;
	},
	10,
	2
);

Describe alternatives you've considered

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Incoming

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions