Bp_Search_Activities::generate_html( $template_type = '' )

Description

Source

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

		protected function generate_html( $template_type='' ){
			$post_ids_arr = array();
			foreach( $this->search_results['items'] as $item_id=>$item_html ){
				$post_ids_arr[] = $item_id;
			}

			$post_ids = implode( ',', $post_ids_arr );

			do_action( 'bp_before_search_activity_html' );

			if( bp_has_activities( array( 'include'=>$post_ids, 'per_page'=>count($post_ids_arr) ) ) ){
				while ( bp_activities() ){
					bp_the_activity();

					$result = array(
						'id'	=> bp_get_activity_id(),
						'type'	=> $this->type,
						'title'	=> $this->search_term,
						'html'	=> bp_search_buffer_template_part( 'loop/activity', $template_type, false ),
					);

					$this->search_results['items'][bp_get_activity_id()] = $result;
				}
			}

			do_action( 'bp_after_search_activity_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.