BP Profile Search › Conditional fields
-
AuthorPost
-
Henry
GuestHi Andrea,
Thanks for creating such a great plugin. I’m aware it doesn’t yet support conditional field logic so was going to try to add it myself.
Do you have any tips on the best way to approach this?
andrea
Plugin AuthorHi Henry,
A good solution could be this plugin:
https://buddydev.com/plugins/conditional-profile-fields-for-buddypress/
To make it work with BP Profile Search forms, add this code to your bp-custom.php file, or at least in the page(s) where search forms are displayed:
add_filter( 'bp_is_conditional_profile_field_active', '__return_true' );Henry
GuestMany thanks @andrea, that’s fantastic.
Henry
Henry
GuestI’ve been doing some testing this weekend, everything seems to be working great aside from a minor bug which results in fields not being hidden from the search form. I think the issue may relate to the Conditional Profile Fields for BuddyPress plugin. Posting the bug report here for reference:
https://github.com/sbrajesh/conditional-profile-fields-for-buddypress/issues/8
andrea
Plugin AuthorThanks Henry for your feedback!
Do you see the bug also in the members Edit Profile page, or only in BP Profile Search forms?
Henry
GuestHi Andrea,
I see the bug in the edit profile page and on BP Profile Search forms.
Hope this helps.
andrea
Plugin AuthorThank you! Then the issue is most likely unrelated to BP Profile Search, and I’m sure Brajesh will sort it out.
Henry
GuestYeah, I thought that too.
Thanks again,
HenryMIchael
GuestHi Andrea,
I have the same problem .
As you say i add the text add_filter( ‘bp_is_conditional_profile_field_active’, ‘__return_true’ ); to bp-custom.php file but nothing happened.
in the registration form the Conditional Profile Fields works perfect but in the BP search fields it is not .
Can you please help .Thanks
andrea
Plugin AuthorHi Michael,
Where is your bp-custom.php? It should be in the /wp-content/plugins/ directory.
Alternatively, you can add that code to functions.php in your active theme directory.
Please let me know.
Michael
GuestHi Andrea ,
Thank you for your replay
right my bp-custom.php located in wp-content/pluginsThis is that i have inside the bp-custom.php by default :
cat /www/website/public/wp-content/plugins/bp-custom.php
<?php
if ( !defined( ‘BP_AVATAR_THUMB_WIDTH’ ) )
define( ‘BP_AVATAR_THUMB_WIDTH’, 120 ); //change this with your desired thumb widthif ( !defined( ‘BP_AVATAR_THUMB_HEIGHT’ ) )
define( ‘BP_AVATAR_THUMB_HEIGHT’, 120 ); //change this with your desired thumb heightif ( !defined( ‘BP_AVATAR_FULL_WIDTH’ ) )
define( ‘BP_AVATAR_FULL_WIDTH’, 580 ); //change this with your desired full size,weel I changed it to 260
if ( !defined( ‘BP_AVATAR_FULL_HEIGHT’ ) )
define( ‘BP_AVATAR_FULL_HEIGHT’, 580 ); //change this to default height for full avatar?>
andrea
Plugin AuthorHi Michael,
Your bp-custom.php looks good to me, you can simply add the custom code there or in your theme’s functions.php.
Please make sure there is only a set of conditional fields in a page. For instance, if you are on the registration page and the registration form contains conditional fields, and the same conditional fields are in a BP Profile Search form inside a sidebar widget, the latter conditional fields won’t work. That’s a limitation of the Conditional Fields plugin.
When you go to a different page instead, and there is only the BP Profile Search form in the sidebar widget, the conditional fields start working.
If you still have problems, you could share the URL of your site, either publicly on this forum, or privately in my Contact page.
Michael
GuestMany Thanks i will try .
-
AuthorPost