@kamelblua
Active 3 years, 5 months ago
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Hello, I come back to you, because I did not succeed what I wanted to do, moreover I made some modification in my code, in fact I do not want to filter by groups, but by a meta then, already I coded the code to obtain a user by a meta_value and a meta_key, but I do not know how to add my request in the loop members for which displays me the user in the content members.
function add_filter_society() { ?> <div class="bp-members-filter-wrap subnav-filters filters no-ajax"> <div id="dir-filters-rubrash" class="component-filters clearfix"> <div id="members-order-select-rubrash" class="last filter"> <label class="bp-screen-reader-text" for="members-order-by"> <span>Trier par:</span> </label> <div class="select-wrap"> <select id="members-order-by-rubrash" data-bp-filter="members"> <option selected>Filtre par société</option> <?php global $wpdb; $society_meta = $wpdb->get_results( "SELECT distinct meta_value FROM $wpdb->usermeta WHERE meta_key = 'mepr_societe_facultatif'"); foreach($society_meta as $society) { if(!empty($society->meta_value)) { ?> <option> <?php echo $society->meta_value; ?> </option> <?php } ?> <?php } ?> </select> <span class="select-arrow" aria-hidden="true"></span> </div> </div> </div> </div> <?php } add_action('rb_enter_directory_members_content', 'add_filter_society'); function get_member_by_society() { $user_query_meta = get_users(array( 'meta_key' => 'mepr_societe_facultatif', 'meta_value' => 'selectOption' )); } add_action('rb_enter_directory_members_content', 'get_member_by_society');
Do you have an idea?
Thanks for the answer, I will look into this method.
Viewing 2 replies - 1 through 2 (of 2 total)