Replies
- 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, 8 months ago by
Brajesh Singh. Reason: Code updated
- This reply was modified 7 years, 8 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.
- Brajesh Singh on April 7, 2019 at 6:46 pm in reply to: [Resolved] BuddyPress User Profile Tabs Creator Pro – Modifying Profile Menu Items #22070
Hi Mic,
Thank you.I am glad you found that option 🙂
The Content is the actual content shown on the tab page. It is used in case you add a new Tab or add a new sub tab. When you visit that sub tab, the content is shown.
If a plugin allows passing user id in the shortcode, you can use their shortcode to show displayed user specific content on the profile tab.
Hope that clarifies.
Regards
Brajesh - Brajesh Singh on April 7, 2019 at 6:39 pm in reply to: [Resolved] User Profile Tabs Creator – Tab Visibility – Multiple Options Not Working #22067
Hi Mic,
I am sorry I could not test it earlier. Will do on Monday(tomorrow) and post an update.Regards
Brajesh - Brajesh Singh on April 7, 2019 at 6:38 pm in reply to: [Resolved] FEATURE IDEA – Limit Groups Per User – Redirect after #22066This reply has been marked as private.