I am using Sarah Gooding’s workaround to replace the core mystery man graphic with a custom graphic. It does not work. It continues to render the core mystery man graphic.
Has anyone had any success overwriting the mystery man graphic?
// Source: http://wpmu.org/how-to-add-a-custom-default-avatar-for-buddypress-members-and-groups/
function myavatar_add_default_avatar( $url ) {
return get_stylesheet_directory_uri() .'/images/mystery-man.jpg';
}
add_filter( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' );
Tried this too (got it from http://etivite.com/api-hooks/buddypress/trigger/apply_filters/bp_core_mysteryman_src/).
It did not work either:
apply_filters( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' );
I’ve used this code on my own BuddyPress site. Works like a charm!
Add this to your
bp-custom.php
file, or, if you’re developing a theme, to your theme’sfunctions.php
file.