Hello,
I have installed Profile Search Forms to put the search engine on the member pages. I have two members that I do want to appear in the member type dropdown but two others do not.
I have disabled the options in the profiles I want to hide from “List in directory?” and activated “Exclude members with this type from directory?”.
The problem is that although users do not appear neither in the search nor in the list, the categories do appear in the dropdown.
What can I do to get them covered?
Hello Ramon,
Thank you for the acknowledgement. Please try the following code to exclude specfic member-types from member directory search form field I am supposing you are using “BP Profile Search”
/** * Excluded member type form form * * @return array */ function buddydev_search_excluded_member_types() { // Enter member type name you want to exclude. return array( 'Teacher' ); } add_action( 'bps_edit_field', function ( $field ) { if ( 'bp_member_type' != $field->code || empty( $field->options ) ) { return $field; } $field->options = array_diff( $field->options, buddydev_search_excluded_member_types() ); } );
Use this code in you bp-custom.php file and let me know if it works or not.
Regards
Ravi- This reply was modified 4 years, 6 months ago by Ravi.
Hello Ramon,
Sorry for the inconvenience. Please look the following documentations
https://codex.buddypress.org/themes/bp-custom-php/
Regards
RaviHi Ramon,
Thank you for the reply.
@ravisharma will be assisting you with it tomorrow.About activity stream:- The plugin doe snot hide any user from activity stream as there is no efficient way to do it.
If you still want to do it, Ravi or I may be able to put some code in couple of days. Please let me know if you want to proceed with it.
Regards
Brajesh
You must be logged in to reply to this topic.