Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Add you blog search to the search


yairnazz
Participant

@yairnazz

Well if you need the code…. does this help

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" >';

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

if ( function_exists( 'groups_install' ) ) {
$selection_box .= '<option value="groups">' . __( 'Groups', 'buddypress' ) . '</option>';
}

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

$selection_box .= '</select>';

return apply_filters( 'bp_search_form_type_select', $selection_box );
}

function bp_search_form() {
$form = '
<form action="' . bp_search_form_action() . '" method="post" id="search-form">
<input type="text" id="search-terms" name="search-terms" value="" />
' . bp_search_form_type_select() . '

<input type="submit" name="search-submit" id="search-submit" value="' . __( 'Search', 'buddypress' ) . '" />
' . wp_nonce_field( 'bp_search_form' ) . '
</form>
';

echo apply_filters( 'bp_search_form', $form );
}

Skip to toolbar