Replies
- calu on August 15, 2019 at 11:07 am in reply to: [Resolved] Using Member Type Generator with BP core widgets #24669This reply has been marked as private.
- calu on August 14, 2019 at 11:45 pm in reply to: [Resolved] Using Member Type Generator with BP core widgets #24667
Hi Brajesh, sorry for the misunderstanding, my main question was:
If a profile is looking for another profile of the same gender, this code can’t be used.
Regards
Carsten - calu on August 14, 2019 at 10:00 pm in reply to: [Resolved] Using Member Type Generator with BP core widgets #24665This reply has been marked as private.
- calu on August 14, 2019 at 8:26 pm in reply to: [Resolved] Using Member Type Generator with BP core widgets #24662
*if same gender is chosen in both fields
- calu on August 14, 2019 at 7:31 pm in reply to: [Resolved] Using Member Type Generator with BP core widgets #24661
Hi Brajesh, I look forward to that, thanks.
I discovered an issue with the code above.
If you have an option in the registration page for choosing not only your own gender, but also a field for choosing which gender you are looking for, the member list shows both genders.
Is there a workaround for this?
Regards
Carsten - calu on August 14, 2019 at 1:34 pm in reply to: [Resolved] Using Member Type Generator with BP core widgets #24649
It would be really nice, if this plugin also would be affected by the member type code
- calu on August 14, 2019 at 6:55 am in reply to: [Resolved] Using Member Type Generator with BP core widgets #24647
Hi Brajesh, yes, you are right, it’s from the Recent Profile Visitors plugin
Regards
Carsten - calu on August 13, 2019 at 10:45 pm in reply to: [Resolved] Using Member Type Generator with BP core widgets #24641
Hi Brajesh, yes of course, forgot about the mapping, it’s working now, except for the Most Visited widget?
Regards
Carsten - calu on August 13, 2019 at 10:03 pm in reply to: [Resolved] Using Member Type Generator with BP core widgets #24639
Hi again, I tested the first code based on gender, but it didn’t make any changes in my Members list, which are still showing both genders.
Best
Carstenfunction buddydev_filter_by_opposite_member_type( $args ) { // No need to change members listing if the user is not logged in. if ( ! is_user_logged_in() ) { return $args; } // Map of visible member types based on the member type. // 'male', 'female' are member type names. $visible_types_map = array( 'male' => 'female', 'female' => 'male', ); $member_type = bp_get_member_type( get_current_user_id(), true ); // If the user does not have a member type // or if the user does not need the restriction. if ( empty( $member_type ) || empty( $visible_types_map[ $member_type ] ) ) { return $args; } $args['member_type'] = $visible_types_map[ $member_type ]; return $args; } add_filter( 'bp_after_has_members_parse_args', 'buddydev_filter_by_opposite_member_type' );
- calu on August 13, 2019 at 9:54 pm in reply to: [Resolved] Using Member Type Generator with BP core widgets #24638
Hi Brajesh, thanks for sharing this topic, and the code, which concerns the members list, but will it also affect the BP core widgets?
Regards
Carsten