Bp_Search_Folders::generate_html( $template_type = '' )

Description

Source

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

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

			// now we have all the posts
			// lets do a documents loop
			$args = array(
				'include'      => implode(',',$folder_ids),
				'per_page'     => count( $folder_ids ),
				'search_terms' => false,
			);

			do_action( 'bp_before_search_folders_html' );

			if ( bp_has_folders( $args ) ) {

				while ( bp_folder() ) :
					bp_the_folder();

					$result = array(
						'id'    => bp_get_folder_folder_id(),
						'type'  => $this->type,
						'title' => bp_get_folder_title(),
						'html'  => bp_search_buffer_template_part( 'loop/folder', $template_type, false ),
					);

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

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