Yeah, those functions can’t be simply overridden (like the functions in wp-includes/pluggable.php).
Your best bet is to do the following:
1) Copy the entire function you want to replace yo your functions.php, and change the function name (to something like custom_directory_members_search_form() )
2) Make sure that the template file that calls the template tag (I think it’s members-loop.php, though I’m not in front of my computer at the moment) exists in your child theme. Replace the reference to the original function in that template file to your newly created function name. Then you can customize to your heart’s content.
Hi Boone,
did this to change the text inside the search box for bp_directory_members_search_form but after doing it it broke the ajax sorting (alphabetical, active, newly registered.)
any thoughts on that?
thanks,
Cezar
I’m doing something very similar, and I can see how the Order By dropdown could break easily.
I doubt after a year of no-replies I can expect much help either…
These forums don’t notify people of follow up comments — so, no surprise that Boone didn’t pick up on a further question several months later.
You can try the @username approach in your comment to notify them
I added class="form-control"
to input
and btn
class to submit button
.
Hope this helps.
function cb_bp_directory_members_search_form() {
$search_form_html = '<form action="" method="get" id="search-members-form">
<label><input type="text" class="form-control" name="s" id="members_search" placeholder="'. esc_attr( $search_value ) .'" /></label>
<input type="submit" id="members_search_submit" class="btn" name="members_search_submit" value="' . __( 'Search', 'buddypress' ) . '" />
</form>';
return $search_form_html;
}
add_filter('bp_directory_members_search_form', 'cb_bp_directory_members_search_form');