Can you turn off the default free level in pro sites?

I want to offer only a paid membership and no free level in pro sites. Is there a way to turn off usage of a free level?

Also, is there a setting to remove registering of just a user name/account? I don't see an option to allow visitors to only register sites.

thanks

  • Alexander

    Hi @Danny,

    If you enable the "Pay to Blog" module, it will require users to upgrade to a Pro Level before allowing them into their dashboard. It will also suspend accounts that fail to make payment until a new payment is made.

    Also, is there a setting to remove registering of just a user name/account? I don't see an option to allow visitors to only register sites.

    This is actually a Wordpress Multisite issue. They don't have an option for this in registration settings. Here's a code snippet I've put together to override this. Just include this in a plugin or your themes functions.php

    /*
     * Remove option for blog / user signup - "Gimme a site" will no longer show
     */
    
    add_action('signup_hidden_fields','remove_signup_option');
    function remove_signup_option(){
    	//Predefine what kind of registration is happening.
    	//Wordpress won't show the option if one is already declared
    	global $active_signup;
    	$active_signup='blog';
    }

    Thanks for being a WPMU DEV member. Let us know if we can be of any further assistance.
    Best regards,

  • Danny

    Thanks, I tried that and get a bunch of these errors:

    Warning: Cannot modify header information - headers already sent by (output started at /home/janua/public_html/wp-content/themes/blogs-mu-child/functions.php:13) in /home/janua/public_html/wp-includes/pluggable.php on line 701

    Here is the functions.php that I created:

    <?php
    /*
    * Remove option for blog / user signup - "Gimme a site" will no longer show
    */

    add_action('signup_hidden_fields','remove_signup_option');
    function remove_signup_option(){
    //Predefine what kind of registration is happening.
    //Wordpress won't show the option if one is already declared
    global $active_signup;
    $active_signup='blog';
    }
    ?>

    So this functions code is causing some problems. Any ideas?

    thanks

  • Alexander

    Glad you got this worked out!

    Perfect! That worked. Makes you wonder why they have closing tags. :slight_smile:

    Many people still use them at the end of files, but they're still not required. The best example for using a closing tag would be within HTML templates. PHP works great inline with html so you could do something like

    <body>
        <h1><?php bloginfo('title'); ?></h1>
    ....
    </body>

    PHP can executed in small sections throughout an HTML page. But whenever the code doesn't need HTML, it's best to just not close it to give less room for errors.

    @Fla0,

    Were you able to get this worked out? Sounds like theme my login is either using a completely custom registration form, or it does't use the "signup_hidden_fields" action. It might also be using different variable names. Let me know if you still need help here and I can take a look.

    Best regards,

  • Site Division

    @Alexander Rohmann

    Thanks for inquiring about this as I would like to get the registration cleaned up as well. The following code is the TML sign up file form. If you can help it would be greatly appreciated.

    ?php
    
    /*
    
    If you would like to edit this file, copy it to your current theme's directory and edit it there.
    
    Theme My Login will always look in your theme's directory first, before using this default template.
    
    */
    
    ?>
    
    <form id="setupform" method="post" action="<?php $template->the_action_url( 'register' ); ?>">
    
    	<input type="hidden" name="stage" value="validate-blog-signup" />
    
    	<input type="hidden" name="user_name" value="<?php echo esc_attr( $user_name ); ?>" />
    
    	<input type="hidden" name="user_email" value="<?php echo esc_attr( $user_email ); ?>" />
    
    	<?php
    
    	do_action( 'signup_hidden_fields' ); // Wordpress hook
    
    	do_action_ref_array( 'tml_signup_hidden_fields', array( &$template ) ); // TML hook
    
    	?>
    
    	<?php if ( !is_subdomain_install() ) { ?>
    
    	<label for="blogname<?php $template->the_instance(); ?>"><?php _e( 'Site Name:', 'theme-my-login' ); ?></label>
    
    	<?php } else { ?>
    
    	<label for="blogname<?php $template->the_instance(); ?>"><?php _e( 'Site Domain:', 'theme-my-login' ); ?></label>
    
    	<?php } ?>
    
    	<?php if ( $errmsg = $errors->get_error_message( 'blogname' ) ) { ?>
    
    		<p class="error"><?php echo $errmsg ?></p>
    
    	<?php } ?>
    
    	<?php if ( !is_subdomain_install() ) { ?>
    
    		<span class="prefix_address"><?php echo $current_site->domain . $current_site->path; ?></span>
    
    		<input name="blogname" type="text" id="blogname<?php $template->the_instance(); ?>" value="<?php echo esc_attr( $blogname ); ?>" maxlength="60" /><br />
    
    	<?php } else { ?>
    
    		<input name="blogname" type="text" id="blogname<?php $template->the_instance(); ?>" value="<?php echo esc_attr( $blogname ); ?>" maxlength="60" />
    
    		<span class="suffix_address"><?php echo ( $site_domain = preg_replace( '|^www\.|', '', $current_site->domain ) ); ?></span><br />
    
    	<?php } ?>
    
    	<?php if ( !is_user_logged_in() ) {
    
    		if ( !is_subdomain_install() )
    
    			$site = $current_site->domain . $current_site->path . __( 'sitename' );
    
    		else
    
    			$site = __( 'domain' ) . '.' . $site_domain . $current_site->path;
    
    		echo '<p>(<strong>' . sprintf( __( 'Your address will be %s.', 'theme-my-login' ), $site ) . '</strong>) ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!', 'theme-my-login' ) . '</p>';
    
    	} ?>
    
    	<label for="blog_title<?php $template->the_instance(); ?>"><?php _e( 'Site Title:', 'theme-my-login' ); ?></label>
    
    	<?php if ( $errmsg = $errors->get_error_message( 'blog_title' ) ) { ?>
    
    		<p class="error"><?php echo $errmsg ?></p>
    
    	<?php } ?>
    
    	<input name="blog_title" type="text" id="blog_title<?php $template->the_instance(); ?>" value="<?php echo esc_attr( $blog_title ); ?>" />
    
    	<div id="privacy">
    
    		<p class="privacy-intro">
    
    			<label for="blog_public_on<?php $template->the_instance(); ?>"><?php _e( 'Privacy:', 'theme-my-login' ); ?></label>
    
    			<?php _e( 'Allow my site to appear in search engines like Google, Technorati, and in public listings around this network.', 'theme-my-login' ); ?>
    
    			<br style="clear:both" />
    
    			<label class="checkbox" for="blog_public_on<?php $template->the_instance(); ?>">
    
    				<input type="radio" id="blog_public_on<?php $template->the_instance(); ?>" name="blog_public" value="1" <?php if ( !isset( $_POST['blog_public'] ) || $_POST['blog_public'] == '1' ) { ?>checked="checked"<?php } ?> />
    
    				<strong><?php _e( 'Yes', 'theme-my-login' ); ?></strong>
    
    			</label>
    
    			<label class="checkbox" for="blog_public_off<?php $template->the_instance(); ?>">
    
    				<input type="radio" id="blog_public_off<?php $template->the_instance(); ?>" name="blog_public" value="0" <?php if ( isset( $_POST['blog_public'] ) && $_POST['blog_public'] == '0' ) { ?>checked="checked"<?php } ?> />
    
    				<strong><?php _e( 'No', 'theme-my-login' ); ?></strong>
    
    			</label>
    
    		</p>
    
    	</div>
    
    	<?php
    
    	do_action( 'signup_blogform', $errors ); // Wordpress hook
    
    	do_action_ref_array( 'tml_signup_blogform', array( &$template ) ); // TML hook
    
    	?>
    
    	<p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Signup', 'theme-my-login' ); ?>" /></p>
    
    </form>
    
    <?php $template->the_action_links( array( 'register' => false ) ); ?>
  • Alexander

    Hi @Fla0,

    Glad you got this figured out. I was about to say, a CSS solution would be good here. There are also ways to change the option after the page loads via jQuery if it wasn't the default.

    That looks like the form for the second page where the blog is created, (after the user already chose to create one) so the other option would be handled from another section of code.

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.