Bp_Search_Members::generate_html( $template_type = '' )

Description

Source

File: bp-search/classes/class-bp-search-members.php

		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.