The MU forums have moved to WordPress.org

allow user registrations, disable blog registrations (4 posts)

  1. re5et
    Member
    Posted 16 years ago #

    I was looking for a way to disable blog registrations and enable user registrations, and couldn't find anything in the options that would allow for it. (No need to point out that i could use plain old WP i have my reasons.)

    Anyhow, I came up with the following code for a plugin. Please critique and let me know if you see any potential for abuse. Its not fancy, but appears to do the job.

    
    function kill_blog_signup(){
    if( FALSE !== strpos($GLOBALS['PHP_SELF'], 'wp-signup.php') ){
    		if($_REQUEST['signup_for'] == 'blog'){
    			$home = get_bloginfo('home');
    			header("Location: $home");
    			die();
    		}
    	}
    }
    
    add_action( 'init', 'kill_blog_signup' );
    
  2. lunabyte
    Member
    Posted 16 years ago #

    Sure would be much easier to just comment out the blog option, and force the username option to be selected in wp-signup.php.

  3. re5et
    Member
    Posted 16 years ago #

    agreed, but i am trying to avoid core file edits if at all possible. I also don't intend to show the first part of wp-signup, i would be posting to it from somewhere else.

  4. lunabyte
    Member
    Posted 16 years ago #

    If you really get heavy into MU, core edits are unavoidable.

    As long as you keep track of what you edit, and where, it isn't a big deal.

About this Topic