Bp_Search_Members::generate_html( $template_type = '' )
Description
Source
File: bp-search/classes/class-bp-search-members.php
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | protected function generate_html( $template_type = '' ){ $group_ids = array (); foreach ( $this ->search_results[ 'items' ] as $item_id => $item ){ $group_ids [] = $item_id ; } do_action( 'bp_before_search_members_html' ); //now we have all the posts //lets do a groups loop if ( bp_has_members( array ( 'search_terms' => '' , 'include' => $group_ids , 'per_page' => count ( $group_ids ) ) ) ) { while ( bp_members() ) { bp_the_member(); $result_item = array ( 'id' => bp_get_member_user_id(), 'type' => $this ->type, 'title' => bp_get_member_name(), 'html' => bp_search_buffer_template_part( 'loop/member' , $template_type , false ), ); $this ->search_results[ 'items' ][ bp_get_member_user_id() ] = $result_item ; } } do_action( 'bp_after_search_members_html' ); } |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.