Forum Replies Created
-
BuddyPress doesn’t have role based access management system for its components like WordPress roles, However, It has Member Type API now which is a potential lead to creating access management system using member type.
I am actually working on creating this plugin, which will be extension of my another plugin,
http://rimonhabib.com/buddypress-member-type-manager/This plugin allows you to synchronize member types with WordPress user role, which is a potential way to control content based on Member type
By the way, you can turn off friend, messaging features from BuddyPress settings. But I guess you are talking about interacting one specific type of users to that type of users only, in this case, you must need to use Member Type API anyway.
Just published an upgraded solution for this problem using BuddyPres Member Type API
Might be helpful for you,
http://rimonhabib.com/buddypress-member-type-manager/you can redirect logged out users from activity page to home (or any page you prefer) using this function
function restrict_activity_page_from_logged_out_users(){ global $bp; if( $bp->current_component === 'activity' && !is_user_logged_in() ) bp_core_redirect( site_url() ); // for home page; or use wp_login_url() to redirect to login page exit; } add_action('wp','restrict_activity_page_from_logged_out_users');
BuddyPress doesn’t have role based access management system for its components like WordPress roles, However, It has Member Type API now which is a potential lead to creating access management system using member type.
I am actually working on creating this plugin, which will be extension of my another plugin, BuddyPress Member Type ManagerBy the way, you can turn off friend, messaging features from BuddyPress settings. But I guess you are talking about interacting one specific type of users to that type of users only, in this case, you must need to use Member Type API anyway.
If you want to redirect all users(admin,subscriber,all roles) to homepage after login, just use this line at your theme functions.php file
add_filter( 'login_redirect', create_function( '$url,$query,$user', 'return home_url();' ), 30, 3 );
Or if you filter a bit, like Admin users will redirected to dashboard, and all others to home page, you can place this code instead of that
function wp_bp_custom_login_redirect( $redirect_to, $request, $user ) { global $user; if ( isset( $user->roles ) && is_array( $user->roles ) ) { if ( in_array( 'administrator', $user->roles ) ) { return $redirect_to; } else { return home_url(); } } else { return $redirect_to; } } add_filter( 'login_redirect', 'wp_bp_custom_login_redirect', 30, 3 );
hello @jrufitpro
I am planning to write a detail tutorial about use of bp_adtivity_add() function later today. I will update you with tutorial link. If i forget, please just remind me with a comment.If you want to redirect all users(admin,subscriber,all roles) to homepage after login, just use this line at your theme functions.php file
add_filter( 'login_redirect', create_function( '$url,$query,$user', 'return home_url();' ), 30, 3 );
Or if you filter a bit, like Admin users will redirected to dashboard, and all others to home page, you can place this code instead of that
function wp_bp_custom_login_redirect( $redirect_to, $request, $user ) { global $user; if ( isset( $user->roles ) && is_array( $user->roles ) ) { if ( in_array( 'administrator', $user->roles ) ) { return $redirect_to; } else { return home_url(); } } else { return $redirect_to; } } add_filter( 'login_redirect', 'wp_bp_custom_login_redirect', 30, 3 );
Frankly saying, This is something concern of theme, not plugin, as plugin developer won’t know theme structure and styling users are using, unless they use BuddPress default template parts. I did that thing actually in one of my other plugin, BuddyPress User Account Type, It wasn’t good as I said, Its theme dependent.
But It is a nice feature to have actually, I am considering to develop a separate plugin soon for this feature, tho I need to see the feasibility first.
Hi, you may try this,
wpbpshop.com/buddypress-user-account-type-proIt seems this is the perfect solution for you
http://wpbpshop.com/buddypress-user-account-type-pro