Skip to:

Set bbpress roles on New user form

  • Mike Brooks


    I am trying to place the forum Roles section, like the section that appears in Edit user, on the new user form. My site is private, so any new users are created by the admin. I’d very much like the admin to only have to go to this screen for user permissions. I’ve managed to get my other plugin and custom fields on the page, but I haven’t figured out how to do it with bbPress. Could someone help me out? For all general purposes, I am using the add_action hook user_new_form then setting the values with update_user_meta in my theme’s function.php page. I see that bbPress sets values in the clr_usermeta database, but I’m unclear on what to set and how. Also, I always want the default value for the role field to be participant. I have search reasonably thoroughly for a clear answer to this and haven’t had much luck. I welcome any help you may have.

Viewing 1 replies (of 1 total)
  • If you take a look at a single users profile and the ‘edit’ section:

    If you look in content-single-user.php you’ll see:

    <?php if ( bbp_is_single_user_edit() ) bbp_get_template_part( 'form', 'user-edit' ); ?>

    Open the form-user-edit.php template:

    <?php do_action( 'bbp_user_edit_before_role' ); ?>
    	<?php bbp_get_template_part( 'form', 'user-roles' ); ?>
    <?php do_action( 'bbp_user_edit_after_role' ); ?>

    (I removed some of the multisite network user role code for readability above)

    Open up the form-user-roles.php template:

    <?php bbp_edit_user_forums_role(); ?>

    The role that will be the default when you add this to your ‘New User Form’ will be the default ‘participant’ if that is what you have set the default role as in bbPress settings.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar