Disable Cover Images for BuddyPress 2.4
This post is aimed at theme developers. BuddyPress 2.4 introduces cover images for profile and groups. Though it is a great feature, if your theme has custom templates for BuddyPress, you will need to make the changes as per this codex article on BuddyPress Cover Image.
If you are like me and believe that it is very limited (I like the uploader but the implementation in bp-legacy template pack sets a bad precedent ), you can disable it unless your theme is ready for it.
To disable the cover image completely, you can put these two lines in your theme's functions.php (bp-custom.php in plugins directory is fine too, but a theme has no control over bp-custom.php) and all the traces of the cover image will be gone from admin settings as well as front end.
add_filter( 'bp_is_profile_cover_image_active', '__return_false' );
add_filter( 'bp_is_groups_cover_image_active', '__return_false' );
The first line disables the profile cover image and the second line disables the group cover image.
If you are a site admin looking at this post, no need to worry, you can always disable it from BuddyPress->Settings screen. There is no need to use code.
I will certainly recommend making your theme ready by reading the codex article linked at the beginning of this post, but do not follow the way bp-legacy template pack has it. There is no need to use extra/additional header file. Also, if you implement the cover image, make sure to use some type of mask to make the texts readable. Do not trust the users to upload images with contrast. A bright image can kill the whole look and usability. Using mask makes it much more usable.
Hey Brajesh, the filter doesn't work by itself. Testing with BuddyPress 2.4.0-rc1.
Thank you for the comment and testing.
Please change 'xprofile' to 'profile' in the code and it will work. I was using some other filter 'bp_disable_cover_image_uploads' too, so did not notice that.
Updated the code in post now. That will work. Please do check and let me know.
That's right! That was the problem! Thanks! =)
Very useful post for me.