Replies
- Brajesh Singh on April 8, 2019 at 10:36 am in reply to: [Resolved] BuddyPress User Profile Tabs Creator Pro – Modifying Profile Menu Items #22095
Hi Mic,
I did release an update for visibility fix on another thread but missed the admin bar update. Will be adding in next iteration.Thank you
Brajesh - Brajesh Singh on April 8, 2019 at 10:35 am in reply to: [Resolved] User Profile Tabs Creator – Tab Visibility – Multiple Options Not Working #22094
Hi Mic,
Thank you for the patience.
I have looked at it now. It was a bug in the visibility option we have.
Please upgrade to 1.1.8
https://buddydev.com/plugins/buddypress-user-profile-tabs-creator-pro/This should work.
Regards
Brajesh - Brajesh Singh on April 8, 2019 at 7:05 am in reply to: [Resolved] BP Multi Network (need some advice, please.) #22093
Hi Rick,
Thank you.Please put this code in your bp-custom.php
/** * Add user as subscriber to current blog. * * @param int $user_id user id. */ function buddydev_custom_add_to_blog_on_register( $user_id ) { // add as a subscriber to current blog. add_user_to_blog( get_current_blog_id(), $user_id, 'subscriber' ); } add_action( 'user_register', 'buddydev_custom_add_to_blog_on_register' );That will add a user to current blog on signup.
Bets Regards
Brajesh - Brajesh Singh on April 8, 2019 at 7:01 am in reply to: [Resolved] Profile visibility in members directory for logged in users only?? #22091
Thank you.
- Brajesh Singh on April 8, 2019 at 6:57 am in reply to: [Resolved] How to get the avatar associated with a member type? #22090
Oops. It seems I have been messing it.
Please keep using your own for now. It does causes double query but is still better than my suggestion.
I will share better code later today.
regards
Brajesh - Brajesh Singh on April 8, 2019 at 6:56 am in reply to: [Resolved] How to get the avatar associated with a member type? #22089
Hi Timothy,
Your code will work fine. By using my previous suggestion, you can avoid extra database query for fetching post type entries(We already fetch them for .PS:- Please use my updated code. In the previous code even I used an inefficient internal method.
Regards
Brajesh - Brajesh Singh on April 8, 2019 at 6:51 am in reply to: [Resolved] BP Ajax Registration – Overriding modal styles from theme #22085
Hi Diana,
Thank you for the reply.
yes, you are right about it.We need to maintain the same hierarchy as in the plugin.
PS:- Thank you for the email.
Best regards
Brajesh - Brajesh Singh on April 8, 2019 at 6:50 am in reply to: [Resolved] hiding users by id, not just admins #22083
Hi Kristian,
Thank you for teh question.Please change this line
$new_excluded = array_merge( $excluded, $user_ids );to
$other_ids = array( 1,2,3,4,5); //update it with correct ids $new_excluded = array_merge( $excluded, $user_ids, $other_ids );That should do it.
Regards
Brajesh - Brajesh Singh on April 8, 2019 at 6:49 am in reply to: [Resolved] How to get the avatar associated with a member type? #22082
Hi Timothy,
At the moment, we don’t have an API for retrieving the Avatar URL for member type. It is an isolated module.There is a way to get the avatar url efficiently(there are other option but that does not uses proper caching).
I wrote a custom function that you may use
/** * Get avatar associated with a member type. * * @param string $member_type member type. * @param string $thumb_type thumbnail type(thumb|full). * * @return string */ function mtp_custom_get_avatar_url( $member_type, $thumb_type = 'thumb' ) { $mtp_object = bpmtp_get_member_type_entry( $member_type ); if ( ! $mtp_object ) { return ''; } $post_id = $mtp_object->post_id; if ( ! $post_id ) { return ''; } $avatar_url = ''; switch ( $thumb_type ) { case 'thumb': $avatar_url = get_post_meta( $post_id, '_bp_member_type_associated_avatar_thumb_url', true ); break; case 'full': $avatar_url = get_post_meta( $post_id, '_bp_member_type_associated_avatar_full_url', true ); break; } return $avatar_url; }Once you have put it in your theme’s functions.php or bp-custom.php in wp-content/plugins. you can use it to get the url of the avatar image.
Hope that helps.
Regards
Brajesh- This reply was modified 7 years, 4 months ago by
Brajesh Singh. Reason: Code updated
- This reply was modified 7 years, 4 months ago by
- Brajesh Singh on April 7, 2019 at 6:46 pm in reply to: [Resolved] Plugin or snippet for limit the number Go #22071This reply has been marked as private.