cjyabraham
Forum Replies Created
-
I think I’ve accomplished it for Countries. Here’s the code if anyone’s interested. Let me know if you have any comments:
+// filters Ultimate Member countries to show only those that are set by members in the db
+add_filter( ‘um_search_field_country’, ‘filter_countries’ );
+function filter_countries( $attrs ) {
+ global $wpdb;
+ $results = $wpdb->get_results( “SELECT distinct meta_value FROM {$wpdb->prefix}usermeta WHERE meta_key = ‘country’ ORDER BY meta_value” );
+ $countries_in_use = Array();
+
+ foreach ( $results as $result ) {
+ $countries_in_use[] = $result->meta_value;
+ }
+
+ $attrs[‘options’] = $countries_in_use;
+
+ return $attrs;
+}I think this is the same problem we’re discussing here:
https://www.ads-software.com/support/topic/search-result-19/+1 as it’s a problem for me too.
resolved
Excellent. Thanks for this.
BTW, the key session start command is includes/core/um-filters-members.php:440. If I comment it out then I don’t have sessions but probably I’m losing other functionality as well…