Skip to:
Content

BuddyPress.org

Opened 15 years ago

Closed 14 years ago

#2255 closed enhancement (fixed)

merging wp search and buddypress search on same form

Reported by: pedromiguel's profile PedroMiguel Owned by: sorich87's profile sorich87
Milestone: 1.5 Priority: normal
Severity: Version:
Component: Core Keywords: has-patch, needs-testing
Cc:

Description

on bp-core-tempaltetags.php change this:

function bp_search_form_type_select() {
	// Eventually this won't be needed and a page will be built to integrate all search results.
	$selection_box = '<select name="search-which" id="search-which" style="width: auto">';

	if ( function_exists( 'xprofile_install' ) ) {
		$selection_box .= '<option value="members">' . __( 'Members', 'buddypress' ) . '</option>';
	}

to this:

function bp_search_form_type_select() {
	// Eventually this won't be needed and a page will be built to integrate all search results.
	$selection_box = '<select name="search-which" id="search-which" style="width: auto">';
$selection_box .= '<option value="blog">' . __( 'Blog', 'buddypress' ) . '</option>';

	if ( function_exists( 'xprofile_install' ) ) {
		$selection_box .= '<option value="members">' . __( 'Members', 'buddypress' ) . '</option>';
	}

and on bp-core.php

change this:

if ( !$slug || empty( $slug ) ) {
			switch ( $search_which ) {
				case 'members': default:
					$slug = BP_MEMBERS_SLUG;
					$var = '/?s=';
					break;

to this:

if ( !$slug || empty( $slug ) ) {
			switch ( $search_which ) {
					case 'blog': default:
					$slug = '';
					$var = '/?s=';
					break;
				case 'members':
					$slug = BP_MEMBERS_SLUG;
					$var = '/?s=';
					break;

Attachments (1)

2255.diff (3.9 KB) - added by sorich87 14 years ago.

Download all attachments as: .zip

Change History (6)

#1 @DJPaul
15 years ago

  • Keywords needs-testing added

#2 @johnjamesjacoby
15 years ago

  • Keywords search integrated search removed
  • Milestone changed from 1.2.4 to 1.3

#3 @boonebgorges
14 years ago

Can I suggest that the dropdown option read 'Posts' rather than 'Blog'?

@sorich87
14 years ago

#4 @sorich87
14 years ago

  • Keywords has-patch added; has_patch removed
  • Owner set to sorich87
  • Status changed from new to accepted

#5 @djpaul
14 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [4172]) Add search posts option into the header search box. Fixes #2255, props PedroMiguel and sorich87.
Also fixes search handling which was broken.

Note: See TracTickets for help on using tickets.