Replies
- Brajesh Singh on October 15, 2018 at 9:18 pm in reply to: [Resolved] Adding User Role or a member type as new visibilty level #18087
Thank you for the kind words Michael.
I am glad I could assist. Thank you too as I too believe that it will help others.Best Regards
Brajesh Hi Diane,
Welcome to BuddyDev forums.I am sorry but I am unable to understand the issue. Is this plugin not restricting users registration while using ultimate member?
No, you do not need Ultimate Member pro for this.
Please let me know and I will assist.
Thank you
Brajesh- Brajesh Singh on October 15, 2018 at 6:08 pm in reply to: [Resolved] [BuddyPress Group Tabs Creator Pro] activate/deactivate for specific groups #18083
Hi Hugo,
You can disable the blog tab per group basis. Please visit Group->manage->settings and there should be an option for the same. Hi Sumit,
Are you using a custom theme? Try changing it and using default theme. I have seen themes filtering on ‘pre_get_posts’ and causing it in past.Regards
Brajesh- Brajesh Singh on October 15, 2018 at 1:15 pm in reply to: [Resolved] How to disable public and private messages for specific users #18077
Thank you Tosin,
I will assist you with it today.Regards
Brajesh - Brajesh Singh on October 15, 2018 at 1:15 pm in reply to: [Resolved] Allow user to upload images #18076
Hi Saxena,
Thank you for the update.I am glad it worked. You can review the plugin on https://wordpress.org/plugins/mediapress/
And yes, I am based in India. MediaPress is a product from us, so Yes 🙂
Best regards
Brajesh - Brajesh Singh on October 15, 2018 at 1:10 pm in reply to: [Resolved] paiement with featured Member #18075This reply has been marked as private.
- Brajesh Singh on October 15, 2018 at 4:52 am in reply to: [Resolved] How to disable public and private messages for specific users #18070
Hi Tosin,
I am sorry but we won’t be able to provide free support for 3rd part plugins except BuddyPress. If Ravi prefers, he may support you but I won’t be able to do it.If you want to implement the same with default BuddyPress message button, I will gladly help.
Regards
Brajesh Hi Nate,
I am sorry but I am unable to understand your question.Do you want to implement a custom loop instead of using BuddyPress profile data? If yes, you will need to implement it on your own.
The two options for storing data can be user meta table or a custom table. If search is important, custom table should be preferred.
If you plan to use user meta, you can use WordPress meta api. If you plan to go custom table route, you will need to know $wpdb for making database calls and you should most probably will need to know about the WordPress caching API for caching data.
Regards
Brajesh- Brajesh Singh on October 15, 2018 at 4:12 am in reply to: [Resolved] Adding User Role or a member type as new visibilty level #18068
Hi Michael,
No Problem. Let us change the code a bit.Step 1:- Please remove the old code for member type visibility and use the following
/** * Get an array of member types enable for visibility. * * @return array */ function buddydev_get_visibility_member_types() { return array( 'recruiter', 'staff', ); } /** * Add extra visibility levels. * * @param array $visibilities visibilities. * * @return array */ function buddydev_add_member_type_profile_visibility( $visibilities ) { $member_types = bp_get_member_types( array(), 'object' ); // If there is no registered member type, return the original visibilities. if ( empty( $member_types ) ) { return $visibilities; } $allowed_member_types = buddydev_get_visibility_member_types(); // Add our member type as visibility levels. foreach ( $member_types as $member_type => $member_type_object ) { if ( ! in_array( $member_type, $allowed_member_types ) ) { continue; } $visibilities[ $member_type ] = array( 'id' => $member_type, 'label' => $member_type_object->labels['singular_name'], ); } return $visibilities; } add_filter( 'bp_xprofile_get_visibility_levels', 'buddydev_add_member_type_profile_visibility' ); /** * Hide profile fields based on member type visibility. * * @param array $hidden_levels hidden visibility levels. * @param int $displayed_user_id displayed user id. * @param int $current_user_id logged in user id. * * @return array */ function buddydev_get_hidden_visibility_types_for_user( $hidden_levels, $displayed_user_id, $current_user_id ) { // Consider all listed member types as invisible. $member_types = buddydev_get_visibility_member_types(); // If user is not logged in // All member type visibilities will be hidden. if ( ! is_user_logged_in() ) { $hidden_levels = array_merge( $hidden_levels, $member_types ); } elseif ( ( $displayed_user_id == $current_user_id ) || is_super_admin( $current_user_id ) ) { // Do not hide anything on own profile or viewed by super admin. } else { // User is logged in and viewing other user's profile. $logged_member_types = bp_get_member_type( $current_user_id, false ); // except current user's member type, all other levels will be hidden. if ( $logged_member_types ) { $member_types = array_diff( $member_types, $logged_member_types ); } $hidden_levels = array_merge( $hidden_levels, $member_types ); } return $hidden_levels; } add_filter( 'bp_xprofile_get_hidden_field_types_for_user', 'buddydev_get_hidden_visibility_types_for_user', 10, 3 );Now, in order to limit to only certain member types, all you have to do is change this
return array( 'recruiter', 'staff', );Change the values in this array with the actual member type name(unique name).
Regards
Brajesh