• Resolved nminchow

    (@nminchow)


    Is there a way to set/configure the default value for the “allow users to register” option on newly created multi-sites?

    Thanks,
    Noel

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Justin Fletcher

    (@justinticktock)

    At the moment no, the default is a hard set to not be active by default. Are you allowing users to register a new site and you want them to immediately have the public register new user accounts within the new site?

    I could add a filter in for the setting so that you could hook in using your site template function.php to overwrite this, but I’d like to understand what you are attempting to do first.

    ..Justin

    Thread Starter nminchow

    (@nminchow)

    Yup, you got it. Optimally, users can register new sites and I want the public to be able to signup as users under that site by default.

    A filter to override the value would be perfect when/if you have time!

    Thanks,
    Noel

    Plugin Author Justin Fletcher

    (@justinticktock)

    Actually looking again I have put in a filter for the whole settings array called ‘nsur_settings’. Unfortunately I can’t test this next code at the moment but you should be able to do what you want with something like this….

    add_filter( 'nsur_settings', array( $this, 'allow_public_to_register_by_default' ), 10, 1 );
    
    function allow_public_to_register_by_default( $settings ) {
    	// Override the settings default to allow public to register by default.
    	$settings['nsur_general']['settings'][0]['std'] = TRUE;
    }	

    let me know how you get on.

    Plugin Author Justin Fletcher

    (@justinticktock)

    @nminchow
    How did you get on ?
    I’ll mark this as resolved unless you come back with anything.

    Thread Starter nminchow

    (@nminchow)

    @justinticktock

    I tried this, but wasn’t having any luck. I traced the code and I feel like we were on the right track, but I didn’t spend much time debugging.

    Plugin Author Justin Fletcher

    (@justinticktock)

    @nminchow
    Did you trial creating a new site to check its initial setup?
    The default will only apply for a new site creation, once it exists whatever you set within the settings page will overwrite it.

    Thread Starter nminchow

    (@nminchow)

    @justinticktock
    Yup I was checking with new sites.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Default Value for “Allow Users to Register”’ is closed to new replies.