Replies
- Brajesh Singh on September 27, 2015 at 10:21 pm in reply to: [Resolved] Profile Privacy causing Theme crash WordPress 4.2.4 #580
Thank you Leigh. Closing this topic now. Please feel free to open new topic if needed.
Thank you
Brajesh - Brajesh Singh on September 27, 2015 at 10:19 pm in reply to: "Rate Limit User Activity" Breaks "Activity as Wire" and Notifications #578
Hi Steve,
Have you had any chance to look at the update?
I will appreciate your feedback.Thank you
Brajesh Hi eGuard,
Here is an example functionfunction buddydev_custom_get_users_by_member_types( $ids = array() ) { $ids = wp_parse_id_list( $ids ); if( ! $ids ) { return ; } $args = array( 'user_ids' => $ids, 'populate_extras' => true, //it will fetch names etc and cache member types ); $user_query = new BP_User_Query( $args ); $users = $user_query->results; $user_by_types = array();//multidimensional assay //an Arr of WP_User objects with some added details like last_activity, latest_update etc foreach ( $users as $user ) { $member_type = bp_get_member_type( $user->ID ); if( ! $member_type ) { continue; } $user_by_types[$member_type][] = $user->ID; } print_r( $user_by_types ); }
And you ca call it like this
<?php buddydev_custom_get_users_by_member_types( '1,2,3,4,5,6,7,8');?>
Hope that helps you.
- Brajesh Singh on September 27, 2015 at 9:49 pm in reply to: [Resolved] Prevent subscribers from uploading images? #576
Hi A . Rhein,
I am sorry, That was a mistake in my part.I forgot to put the function we are calling.
Please add this snippet too to your bp-custom.phpfunction buddydev_is_above_subscriber() { if ( current_user_can( 'delete_posts' ) ) { return true; } return false; }
Now, that will work for sure.
- Brajesh Singh on September 26, 2015 at 6:10 pm in reply to: ajax registration still make users confirm their email address #575
Hi Lukas,
Please put the following code in your bp-custom.php or in your functions.phpadd_filter( 'bpajaxr_is_auto_activation_mode', '__return_false' );
That will do it.
- Brajesh Singh on September 24, 2015 at 7:11 pm in reply to: "Rate Limit User Activity" Breaks "Activity as Wire" and Notifications #570
Hi Steve,
I have updated the Rate Limit User activity plugin and now it works fine with BuddyPress Activity AS wire plugin.If you are using BuddyDev dashboard plugin, you can directly update from your plugins page.
Otherwise, please download from herehttps://buddydev.com/plugins/bp-rate-limit-user-activity/
and update.
Please do let me know if that works for you or not?
- Brajesh Singh on September 24, 2015 at 2:05 pm in reply to: "Rate Limit User Activity" Breaks "Activity as Wire" and Notifications #567
Hi Steve,
Sorry about the delay.I tested these two plugins together and here is what i found.
When rate limiter plugin is active, the BuddyPress Activity as wire plugin stops working. Other than that, public notifications etc was working fine for me.
Is that the case for you too? I am working on a compatibility fix right now and will have another update for you soon.
- Brajesh Singh on September 24, 2015 at 1:46 pm in reply to: [Resolved] Open question: member profile vs account #566
You are most welcome 🙂
- Brajesh Singh on September 24, 2015 at 1:23 pm in reply to: [Resolved] Profile Privacy causing Theme crash WordPress 4.2.4 #564
Hi Leigh,
At the moment please put the file in bp-profile-visibility/languages directory in plugin. This is something remaining from our past code. We are updating all our plugins to use the WordPress languages dir as fallback and in future.We will post the changelog when the next version comes.
Sorry for the trouble. Please make sure to keep a backup copy of the languages file safe for future use. Hi,
Welcome to BuddyDev support forum.1. Do you need ids or just the count? If you need just the count here is a function with example to do that
function buddydev_get_member_types_count( ) { $member_types = get_terms( 'bp_member_type', array( 'fields' => 'all', 'hide_empty' => false )); if( ! $member_types ) { return array(); } $counts = array(); foreach ( $member_types as $member_type ) { $counts[ $member_type->slug] = $member_type->count; } return $counts; }
You can put the above code in your bp-custom.php or theme’s functions.php.
And use the following code to show the counts
//example usage in your file $counts = buddydev_get_member_types_count(); echo "Total students:" . $counts['student'];
Please do note, if you are on multisite, this code will only work on main site.
About settings the default member type, yes.
add_action( 'bp_core_activated_user', 'buddydev_set_default_member_type', 1 );//high priority function buddydev_set_default_member_type( $user_id ) { bp_set_member_type( $user_id, 'student' ); }
Please put that code in your bp-custom.php and that should take care of the default assignment.
Hope that helps.