Search Results for 'disable registration'
-
Search Results
-
Topic: Disabling activation
Hey all.
I would like to disable user activation for my Multisite enabled wordpress site.
I created a bp-custom.php file and added the following:<?php
add_filter( ‘bp_registration_needs_activation’, ‘__return_false’ );
?>It doesn’t help. Everything is updated to the last version, site is gamesap.az
Thanks in advance
Topic: Disabling activation
Hey all.
I would like to disable activation for my Multisite enabled wordpress site.
I created a bp-custom.php file and added the following:<?php
add_filter( ‘bp_registration_needs_activation’, ‘__return_false’ );
?>It doesn’t help. Everything is updated to the last version, site is gamesap.az
Thanks in advance
Topic: Disabling activation
Hey all.
I would like to disable activation for my Multisite enabled wordpress site.
I created a bp-custom.php file and added the following:<?php
add_filter( ‘bp_registration_needs_activation’, ‘__return_false’ );
?>It doesn’t help. Everything is updated to the last version, site is gamesap.az
Thanks in advance
Topic: Disabling activation
Hey all.
I would like to disable activation for my Multisite enabled wordpress site.
I created a bp-custom.php file and added the following:<?php
add_filter( ‘bp_registration_needs_activation’, ‘__return_false’ );
?>It doesn’t help. Everything is updated to the last version, site is gamesap.az
Thanks in advance
Topic: Bizarre Activation Issue
Hi there,
I’ve searched through BuddyPress support forums for hours and I haven’t found the solution to this problem.
I’ve disabled all my plugins and re-enabled one by one and the problem still exists.
Basically, when people register, they get the email fine, but when they click through to activate, they are just taken to the activation page and nothing happens. I’ve tried copying the activation code and pasting it in, and then, clicking submit, but that does not work either. I’ve compared the activation code to the user_meta in the database and they match, so the problem isn’t there.
Whenever I click submit, the page simply refreshes back to the activate page with an empty field asking for an activation code again, which is preventing any new user registrations. Any ideas here? I’m completely stumped and I do not wish to disable the activation process.
Latest versions of everything including WP 3.8.2
Hi,
I need to disable the Buddypress registration as it doesn’t meet german law requirements.
I searched the forum already and tried everything but none of the mentioned solutions worked.
The site is running on:
Wordpress 3.8.1
Buddypress 1.9.2
Theme Jarida / TieLabs
Any idea what to do to get BP registration disabled?
Topic: Disable the BP registration
I use a wordpress theme called Premiumpress which has its own built in registration. When BP is active it bypasses the premiumpress registration and sits at http://www.mysite.com/register (this is a blank page)
I need it to direct to wp-login.php?action=register
I have added this code to my themes functions.php:
remove_action( ‘bp_init’, ‘bp_core_wpsignup_redirect’ );
remove_action( ‘bp_screens’, ‘bp_core_screen_signup’ );And this has bypassed the BP registration although it has now disabled the BP members and profile section.
I would be eternally grateful if anyone has any suggestion how I can keep BP enabled yet bypass the registration.
Kind Regards
MarkWP ver3.8.1 & BP ver1.9.2 with multisite enabled.
Website: http://alumnicreator.com/I have the BuddyDev bp multinetwork plugin and have manually created 4 communities all of which have BP enabled and working. Each community is a mapped domain:
Mapped Domain: http://eastatlantaalumni.org/Member registration is allowed and works fine on each of these communities. The problem is with BP registration on the main site. When registering an account or blog I get redirected to the home page after registration. The account or site doesn’t get created and I don’t get any notifications.
I’ve disabled all plugins minus BP and the issue continues to remain on the main site.
When registering user accounts on the sub sites I notice the option to create blogs which should point to http://blogname.alumnicreator.com. This doesn’t happen instead after the account and site are created the site shows as http://blogname. This only happens on the sub sites as stated earlier I’m unable perform any registrations on the main site. I have tickets opened on BuddyDev and WPMU Premium but everything seems to point to BuddyPress. Is there anyway someone can assist as I can’t officially release the site until I can address these issues.
Any assistance or direction is appreciated.Wordpress 3.8.1 bo 1.9.1
Hi,
I have spent hours trying to figure this out. My objective is to allow the user to change their online notification settings but disable the settings>general tab whilst leaving the settings>email menu tab in tact, or disable the output of “change email” and “change password” so it doesn’t show at all on the font end under settings>general.I do not want users to be able to change their passwords or email address through buddypress as I am using formidable pro for my registration for the site.
Is it just a case of editing out a few lines of code or do I need a php script to put in my theme functions.php?
regards
Hi, I was adjusting the registration.php file. Just changing the text eg. “Account Details/Profile Details” to “Create an Account/Create a Profile”
When I uploaded the page back, the layout is completely messed up.
http://unicefchallenge.com/register/
I’M GOING CRAZY, ANY ADVISE ASAP?Thank
`<?php get_header( ‘buddypress’ ); ?><div id=”content”>
<div class=”padder”><?php do_action( ‘bp_before_register_page’ ); ?>
<div class=”page” id=”register-page”>
<form action=”” name=”signup_form” id=”signup_form” class=”standard-form” method=”post” enctype=”multipart/form-data”>
<?php if ( ‘registration-disabled’ == bp_get_current_signup_step() ) : ?>
<?php do_action( ‘template_notices’ ); ?>
<?php do_action( ‘bp_before_registration_disabled’ ); ?><p><?php _e( ‘User registration is currently not allowed.’, ‘buddypress’ ); ?></p>
<?php do_action( ‘bp_after_registration_disabled’ ); ?>
<?php endif; // registration-disabled signup setp ?><?php if ( ‘request-details’ == bp_get_current_signup_step() ) : ?>
<h2><?php _e( ‘Create an Account’, ‘buddypress’ ); ?></h2>
<?php do_action( ‘template_notices’ ); ?>
<p><?php _e( ‘Please create the username and login information you would like to use on the Challenge site.’, ‘buddypress’ ); ?></p>
<?php do_action( ‘bp_before_account_details_fields’ ); ?>
<div class=”register-section” id=”basic-details-section”>
<?php /***** Basic Account Details ******/ ?>
<h4><?php _e( ‘Create an Account’, ‘buddypress’ ); ?></h4>
<label for=”signup_username”><?php _e( ‘Username’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
<?php do_action( ‘bp_signup_username_errors’ ); ?>
<input type=”text” name=”signup_username” id=”signup_username” value=”<?php bp_signup_username_value(); ?>” /><label for=”signup_email”><?php _e( ‘Email Address’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
<?php do_action( ‘bp_signup_email_errors’ ); ?>
<input type=”text” name=”signup_email” id=”signup_email” value=”<?php bp_signup_email_value(); ?>” /><label for=”signup_password”><?php _e( ‘Choose a Password’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
<?php do_action( ‘bp_signup_password_errors’ ); ?>
<input type=”password” name=”signup_password” id=”signup_password” value=”” /><label for=”signup_password_confirm”><?php _e( ‘Confirm Password’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
<?php do_action( ‘bp_signup_password_confirm_errors’ ); ?>
<input type=”password” name=”signup_password_confirm” id=”signup_password_confirm” value=”” /><?php do_action( ‘bp_account_details_fields’ ); ?>
</div><!– #basic-details-section –>
<?php do_action( ‘bp_after_account_details_fields’ ); ?>
<?php /***** Extra Profile Details ******/ ?>
<?php if ( bp_is_active( ‘xprofile’ ) ) : ?>
<?php do_action( ‘bp_before_signup_profile_fields’ ); ?>
<div class=”register-section” id=”profile-details-section”>
<h4><?php _e( ‘Create a Profile’, ‘buddypress’ ); ?></h4>
<?php /* Use the profile field loop to render input fields for the ‘base’ profile field group */ ?>
<?php if ( bp_is_active( ‘xprofile’ ) ) : if ( bp_has_profile( array( ‘profile_group_id’ => 1, ‘fetch_field_data’ => false ) ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?><?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
<div class=”editfield”>
<?php if ( ‘textbox’ == bp_get_the_profile_field_type() ) : ?>
<label for=”<?php bp_the_profile_field_input_name(); ?>”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></label>
<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
<input type=”text” name=”<?php bp_the_profile_field_input_name(); ?>” id=”<?php bp_the_profile_field_input_name(); ?>” value=”<?php bp_the_profile_field_edit_value(); ?>” /><?php endif; ?>
<?php if ( ‘textarea’ == bp_get_the_profile_field_type() ) : ?>
<label for=”<?php bp_the_profile_field_input_name(); ?>”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></label>
<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
<textarea rows=”5″ cols=”40″ name=”<?php bp_the_profile_field_input_name(); ?>” id=”<?php bp_the_profile_field_input_name(); ?>”><?php bp_the_profile_field_edit_value(); ?></textarea><?php endif; ?>
<?php if ( ‘selectbox’ == bp_get_the_profile_field_type() ) : ?>
<label for=”<?php bp_the_profile_field_input_name(); ?>”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></label>
<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
<select name=”<?php bp_the_profile_field_input_name(); ?>” id=”<?php bp_the_profile_field_input_name(); ?>”>
<?php bp_the_profile_field_options(); ?>
</select><?php endif; ?>
<?php if ( ‘multiselectbox’ == bp_get_the_profile_field_type() ) : ?>
<label for=”<?php bp_the_profile_field_input_name(); ?>”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></label>
<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
<select name=”<?php bp_the_profile_field_input_name(); ?>” id=”<?php bp_the_profile_field_input_name(); ?>” multiple=”multiple”>
<?php bp_the_profile_field_options(); ?>
</select><?php endif; ?>
<?php if ( ‘radio’ == bp_get_the_profile_field_type() ) : ?>
<div class=”radio”>
<span class=”label”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></span><?php do_action( bp_get_the_profile_field_errors_action() ); ?>
<?php bp_the_profile_field_options(); ?><?php if ( !bp_get_the_profile_field_is_required() ) : ?>
‘ );”><?php _e( ‘Clear’, ‘buddypress’ ); ?>
<?php endif; ?>
</div><?php endif; ?>
<?php if ( ‘checkbox’ == bp_get_the_profile_field_type() ) : ?>
<div class=”checkbox”>
<span class=”label”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></span><?php do_action( bp_get_the_profile_field_errors_action() ); ?>
<?php bp_the_profile_field_options(); ?>
</div><?php endif; ?>
<?php if ( ‘datebox’ == bp_get_the_profile_field_type() ) : ?>
<div class=”datebox”>
<label for=”<?php bp_the_profile_field_input_name(); ?>_day”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></label>
<?php do_action( bp_get_the_profile_field_errors_action() ); ?><select name=”<?php bp_the_profile_field_input_name(); ?>_day” id=”<?php bp_the_profile_field_input_name(); ?>_day”>
<?php bp_the_profile_field_options( ‘type=day’ ); ?>
</select><select name=”<?php bp_the_profile_field_input_name(); ?>_month” id=”<?php bp_the_profile_field_input_name(); ?>_month”>
<?php bp_the_profile_field_options( ‘type=month’ ); ?>
</select><select name=”<?php bp_the_profile_field_input_name(); ?>_year” id=”<?php bp_the_profile_field_input_name(); ?>_year”>
<?php bp_the_profile_field_options( ‘type=year’ ); ?>
</select>
</div><?php endif; ?>
<?php do_action( ‘bp_custom_profile_edit_fields_pre_visibility’ ); ?>
<?php if ( bp_current_user_can( ‘bp_xprofile_change_field_visibility’ ) ) : ?>
<p class=”field-visibility-settings-toggle” id=”field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>”>
<?php printf( __( ‘This field can be seen by: <span class=”current-visibility-level”>%s</span>’, ‘buddypress’ ), bp_get_the_profile_field_visibility_level_label() ) ?> <?php _ex( ‘Change’, ‘Change profile field visibility level’, ‘buddypress’ ); ?>
</p><div class=”field-visibility-settings” id=”field-visibility-settings-<?php bp_the_profile_field_id() ?>”>
<fieldset>
<legend><?php _e( ‘Who can see this field?’, ‘buddypress’ ) ?></legend><?php bp_profile_visibility_radio_buttons() ?>
</fieldset>
<?php _e( ‘Close’, ‘buddypress’ ) ?></div>
<?php else : ?>
<p class=”field-visibility-settings-notoggle” id=”field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>”>
<?php printf( __( ‘This field can be seen by: <span class=”current-visibility-level”>%s</span>’, ‘buddypress’ ), bp_get_the_profile_field_visibility_level_label() ) ?>
</p>
<?php endif ?><?php do_action( ‘bp_custom_profile_edit_fields’ ); ?>
<p class=”description”><?php bp_the_profile_field_description(); ?></p>
</div>
<?php endwhile; ?>
<input type=”hidden” name=”signup_profile_field_ids” id=”signup_profile_field_ids” value=”<?php bp_the_profile_group_field_ids(); ?>” />
<?php endwhile; endif; endif; ?>
<?php do_action( ‘bp_signup_profile_fields’ ); ?>
</div><!– #profile-details-section –>
<?php do_action( ‘bp_after_signup_profile_fields’ ); ?>
<?php endif; ?>
<?php if ( bp_get_blog_signup_allowed() ) : ?>
<?php do_action( ‘bp_before_blog_details_fields’ ); ?>
<?php /***** Blog Creation Details ******/ ?>
<div class=”register-section” id=”blog-details-section”>
<h4><?php _e( ‘Blog Details’, ‘buddypress’ ); ?></h4>
<p><input type=”checkbox” name=”signup_with_blog” id=”signup_with_blog” value=”1″<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked=”checked”<?php endif; ?> /> <?php _e( ‘Yes, I\’d like to create a new site’, ‘buddypress’ ); ?></p>
<div id=”blog-details”<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class=”show”<?php endif; ?>>
<label for=”signup_blog_url”><?php _e( ‘Blog URL’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
<?php do_action( ‘bp_signup_blog_url_errors’ ); ?><?php if ( is_subdomain_install() ) : ?>
http:// <input type=”text” name=”signup_blog_url” id=”signup_blog_url” value=”<?php bp_signup_blog_url_value(); ?>” /> .<?php bp_blogs_subdomain_base(); ?>
<?php else : ?>
<?php echo home_url( ‘/’ ); ?> <input type=”text” name=”signup_blog_url” id=”signup_blog_url” value=”<?php bp_signup_blog_url_value(); ?>” />
<?php endif; ?><label for=”signup_blog_title”><?php _e( ‘Site Title’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
<?php do_action( ‘bp_signup_blog_title_errors’ ); ?>
<input type=”text” name=”signup_blog_title” id=”signup_blog_title” value=”<?php bp_signup_blog_title_value(); ?>” /><span class=”label”><?php _e( ‘I would like my site to appear in search engines, and in public listings around this network.’, ‘buddypress’ ); ?>:</span>
<?php do_action( ‘bp_signup_blog_privacy_errors’ ); ?><label><input type=”radio” name=”signup_blog_privacy” id=”signup_blog_privacy_public” value=”public”<?php if ( ‘public’ == bp_get_signup_blog_privacy_value() || !bp_get_signup_blog_privacy_value() ) : ?> checked=”checked”<?php endif; ?> /> <?php _e( ‘Yes’, ‘buddypress’ ); ?></label>
<label><input type=”radio” name=”signup_blog_privacy” id=”signup_blog_privacy_private” value=”private”<?php if ( ‘private’ == bp_get_signup_blog_privacy_value() ) : ?> checked=”checked”<?php endif; ?> /> <?php _e( ‘No’, ‘buddypress’ ); ?></label><?php do_action( ‘bp_blog_details_fields’ ); ?>
</div>
</div><!– #blog-details-section –>
<?php do_action( ‘bp_after_blog_details_fields’ ); ?>
<?php endif; ?>
<?php do_action( ‘bp_before_registration_submit_buttons’ ); ?>
<div class=”submit”>
<input type=”submit” name=”signup_submit” id=”signup_submit” value=”<?php _e( ‘Submit’, ‘buddypress’ ); ?>” />
</div><?php do_action( ‘bp_after_registration_submit_buttons’ ); ?>
<?php wp_nonce_field( ‘bp_new_signup’ ); ?>
<?php endif; // request-details signup step ?>
<?php if ( ‘completed-confirmation’ == bp_get_current_signup_step() ) : ?>
<h2><?php _e( ‘Check Your Email To Activate Your Account!’, ‘buddypress’ ); ?></h2>
<?php do_action( ‘template_notices’ ); ?>
<?php do_action( ‘bp_before_registration_confirmed’ ); ?><?php if ( bp_registration_needs_activation() ) : ?>
<p><?php _e( ‘You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.’, ‘buddypress’ ); ?></p>
<?php else : ?>
<p><?php _e( ‘You have successfully created your account! Please log in using the username and password you have just created.’, ‘buddypress’ ); ?></p>
<?php endif; ?><?php do_action( ‘bp_after_registration_confirmed’ ); ?>
<?php endif; // completed-confirmation signup step ?>
<?php do_action( ‘bp_custom_signup_steps’ ); ?>
</form>
</div>
<?php do_action( ‘bp_after_register_page’ ); ?>
</div><!– .padder –>
</div><!– #content –><?php get_sidebar( ‘buddypress’ ); ?>
<script type=”text/javascript”>
jQuery(document).ready( function() {
if ( jQuery(‘div#blog-details’).length && !jQuery(‘div#blog-details’).hasClass(‘show’) )
jQuery(‘div#blog-details’).toggle();jQuery( ‘input#signup_with_blog’ ).click( function() {
jQuery(‘div#blog-details’).fadeOut().toggle();
});
});
</script><?php get_footer( ‘buddypress’ ); ?>’
I’m tweaking the sign-up with some custom validation.
I’m looking through bp_core_screen_signup() in bp-members-screens.php which runs through a battery of tests and then offers the hook bp_signup_validate to perform additional tests, but I need to do something BEFORE it runs through those tests not after.
What can I hook into?
(If you want to know why, I’m trying to make sign-up on mobile as frictionless as possible by not requiring the user to enter their password twice. On my custom registration form I make the input #signup_password_confirm hidden and with javascript just copy over what is entered in #signup_password. But to allow for javascript being disabled I need to repeat if necessary on the server before handing off to the tests in bp_core_screen_signup.)
Topic: Email Verification
Hi, The site that I’m working on is on a free server and all the activation emails goes to the spam folder. I had no choice and disabled the email verification with some hack that I found on this forum and it works fine. The problem is that after registration the screen that tells you to check your email is still appearing. I want to change the text in the screen to “Thank you for registering” or something like that but I can’t find the file that I should modify.
Those anyone have a clue how to do it?
WordPress: 3.8
BuddyPress: 3.9.1
Reg Page: acisweb.org/registerThe registration page doesn’t seem to work properly in any other browser but Chrome. When you fill in the required fields and click submit, nothing happens the page stays as is. We have tested this in Chrome, Firefox, Opera and IE on both Macs and PCs.
I have tried this by using the default TwentyTwelve theme. I have tried this with all plugins disabled. In both cases, the error still occurred. I even validated the page via WC3 and still nothing happened. Also, allow users to register is enabled.
The final kicker is that every once in a while, I can register via Safari on a Mac, but often times I cannot. This is driving me nuts. Any help/suggestions would be appreciated. I have searched everywhere and tried everything.
Thanks.
Topic: Registration does not work
Hi all,
My site, hiddencove.villagegate.com, is having registration issues pertaining to Buddypress. When Buddypress is not activated, registration works entirely. However, once activated, the register link on the log in page (accessed by clicking on the link to any of the three portals) simply redirects back to the log in, preventing new user registration.
We have tried adding the following code as well:
function my_disable_bp_registration() {
remove_action( ‘bp_init’, ‘bp_core_wpsignup_redirect’ );
remove_action( ‘bp_screens’, ‘bp_core_screen_signup’ );
}
add_action( ‘bp_loaded’, ‘my_disable_bp_registration’ );add_filter( ‘bp_get_signup_page’, “firmasite_redirect_bp_signup_page”);
function firmasite_redirect_bp_signup_page($page ){
return bp_get_root_domain() . ‘/wp-signup.php’;
}and subsets of it. When put into the theme’s function.php, it seemed to have no effect. When put in bp-custom.php, the registration page is activated and an email is received to activate accounts, but clicking on the activation link redirects you to the log in page, before you ever receive a password.
We are using WordPress 3.7.1 and Buddypress version 1.8.1, and have a network installation. Please note that we do have a multisite that currently only consists of the provided subdomain (hiddencove). Expansion is planned later but we are starting off as a multi-site from the get-go. This issue existed before switching to a multisite, and exists regardless of whether Buddypress is site- or network-activated. It persists when all other themes and plugins are disabled as well. We have tried rolling back to a previous version of WordPress (3.6) to check for compatibility issues, but issues persisted and we are back at 3.8.1.
Finally, registration is enabled in network settings, and the registration page has been set in Buddypress settings.
Thank you ahead of time for any leads you provide!
This topic has been always important to my community project. Throughout the last 4 years I’ve tried several ways to reach a way working with different user profiles. If you search the forums you’ll see that others also did and still do.
Maybe my approach/solution will fit some of the requests.
First of all, I’ve to say THANK YOU to the following people/users:@henrywright-1 for some hints into the right direction
donmik, publisher of the wonderful Buddypress Xprofile Custom Fields Type plugin
and Brajesh Singh @sbrajesh for his usefull code snippets.So, what I needed and what was the solution?
I’m working on a platform for musicians and music fans. To give both usertypes different capabilities in their profiles I decided to give them different user roles.
To achive this, there are several wordpress plugins. Below you will find a list of the plugins I use.
In earlier versions of Buddypress I’ve used the WP Roles at Registration plugin together with Buddypress xProfiles ACL plugin. So I had the possibility to make the user chose a role at registration and a way to define what buddypress profile groups are shown in the different profile types. Both plugins haven’t been updated in the last two years but both still work. xProfiles ACL needs to be hacked – see this support thread .So far so good. But there is no way to include the user role (in my case “band” and “fan”) in buddypress search. My first attempt was to include the user role via some code snippet in my member-loop, but that seemed a bit complicated to me. I wanted a conjunction between the user role and buddypress search. So there had to be a way to select the user role through a xprofile field, ’cause xprofile fields can be searched and also displayed in the member-loop in several ways.
To stop confusing you, here’s what I’ve done:
required plugins:
- Buddypress xProfiles ACL with the hack mentioned a few lines earlier.
- Capability Manager Enhanced to define custom user roles, if you’re not satisfied with the default wordpress roles (subscriber, contributor,…).
The first step is to create your user roles, modify the ACL plugin and define some profile field groups that can be finally added to the different user roles/types.
Create a xprofile field (selectbox) with the title “User Role” and name the options “Band Role” and “Fan Role” – in my case. You can call them whatever you want. Place this field in the “base” profile group, otherwise it won’t be shown during registration. Also make the field “required”. In my case the user can’t decide, if the visibility of the field can be changed.In a second step you need to create a bp-custom.php in the root of your wordpress plugin folder (if you haven’t done this yet, cause you have other custom functions).
Put the following snippet in your bp-custom:<?php function custom_bp_core_signup_user($user_id) { $user_role = strtolower(xprofile_get_field_data('User Role', $user_id)); switch($user_role) { case "Band Role": $new_role = 'band'; break; case "Fan Role": $new_role = 'fan'; break; } wp_update_user(array( 'ID' => $user_id, 'role' => $new_role )); } add_action( 'bp_core_signup_user', 'custom_bp_core_signup_user', 10, 1);As you can see, I’ve included the title of the xprofile field in line 3. It’s important to put in the exact title of your xprofile field. The case “Band Role” and case “Fan Role” is the place to put your select options of the field. Finally $new_role has to be filled with the wordpress or custom user roles – important, otherwise it won’t work: in lowercase letters – in my case “band” and “fan”.
Save your bp-custom.php and you’re nearly done.
In my case I want to prevent the users to change their user role after registration (if you want to give them the possibility to do so, more hacking has to be done – but I’m not sure how to). Put another snippet in your bp-custom.php://hide the user role select field in edit-screen to prevent changes after registration add_filter("xprofile_group_fields","bpdev_filter_profile_fields_by_usertype",10,2); function bpdev_filter_profile_fields_by_usertype($fields,$group_id){ //only disable these fields on edit page if(!bp_is_profile_edit()) return $fields; //please change it with the name of fields you don't want to allow editing $field_to_remove=array("User Role"); $count=count($fields); $flds=array(); for($i=0;$i<$count;$i++){ if(in_array($fields[$i]->name,$field_to_remove)) unset($fields[$i]); else $flds[]=$fields[$i];//doh, I did not remember a way to reset the index, so creating a new array } return $flds; }Again, fill in the title of the profile field (User Role), where it’s indicated in the code.
That’s it. I hope I haven’t been too confusing. Ask if you need help.