Hidden filter
-
Hi Andrea
Been trying to get the snippet you posted in another thread to work (see https://ww.wp.xz.cn/support/topic/improvement-of-the-search-filter-of-the-buddypress-members-page/).
Unfortunately, not having much luck.
Snippet I’ve used:
add_filter ('bps_hidden_filters', 'my_hidden_filters'); function my_hidden_filters ($filters) { $user_id = bp_loggedin_user_id (); if ($user_id != 0) $filters['field_6'] = xprofile_get_field_data (17, $user_id); return $filters; }Field_6 is a “I am a” gender field (drop down select box) and 17 is “I am looking for a” gender field (have tried drop down select box, multi select box and checkboxes – ideal solution being the person can select multiple genders).
If I activate the snippet, it kills the directory and I just get the following warnings:
Warning: explode() expects parameter 2 to be string, array given in ... plugins/bp-profile-search/bps-search.php on line 164 Warning: explode() expects parameter 2 to be string, array given in ... plugins/bp-profile-search/bps-search.php on line 165 Warning: count(): Parameter must be an array or an object that implements Countable in ... plugins/bp-profile-search/bps-search.php on line 167 Warning: count(): Parameter must be an array or an object that implements Countable in ... plugins/bp-profile-search/bps-search.php on line 168 Warning: count(): Parameter must be an array or an object that implements Countable in ... plugins/bp-profile-search/bps-search.php on line 169 Warning: explode() expects parameter 2 to be string, array given in ... plugins/bp-profile-search/bps-search.php on line 180 Warning: count(): Parameter must be an array or an object that implements Countable in ... plugins/bp-profile-search/bps-search.php on line 181 Warning: explode() expects parameter 2 to be string, array given in ... plugins/bp-profile-search/bps-search.php on line 180 Warning: count(): Parameter must be an array or an object that implements Countable in ... plugins/bp-profile-search/bps-search.php on line 181 Warning: Invalid argument supplied for foreach() in ... plugins/bp-profile-search/bps-search.php on line 185Any pointer to where I’m going wrong would be appreciated.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Hidden filter’ is closed to new replies.