Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: How to override core template function

@biswadip

Participant

I put the bp_custom_directory_groups_search_form() function suggested by @meginfo into my functions file.

But when I call it from a template it only works if I submit it to the members directory like this

function bp_custom_directory_members_search_form() {

	$default_search_value = bp_get_search_default_text( 'members' );
	$search_value         = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?>

       <form action="<?php echo site_url() ?>/members/" method="get" id="search-members-form">
		<label><input type="text" name="s" id="members_search" placeholder="<?php echo esc_attr( $search_value ) ?>" /></label>
		<input type="submit" id="members_search_submit" name="members_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
	</form>
<?php
}

If I try to submit to the same page like this:

form action=""

of if I try and submit it to the full path of the file I get a 404 not found message.

How should I submit the function in order to have it give me the search results on the page I want?

Thanks

Skip to toolbar