Hy.
i put this function
function bp_custom_filter_cover_image() {
return 'http://failtrafic.ro/wp-content/uploads/2017/01/iarna.jpg';
}
add_filter( 'bp_attachments_pre_get_attachment', 'bp_custom_filter_cover_image' );
in themes functions.php but not work.
Any sugestion ?
why don’t you use the mentionned plugin ?
Problem solved. Thanks to Brajesh from BuddyDev
1. Disable the cover upload by users
2. Setup a default cover
You can put the following code in your bp-custom.php to achieve that.
Please make sure to change the default_cover image url
/**
* Disable the Change Cover from uSers profile
*/
function buddydev_disable_cover_upload() {
bp_core_remove_subnav_item('profile', 'change-cover-image');
}
add_action( 'bp_xprofile_setup_nav', 'buddydev_disable_cover_upload' );
//set default cover
function buddydev_set_default_profile_cover( $settings = array() ) {
$settings['default_cover'] = 'http://yoursite.com/yourimage.jpg';
return $settings;
}
add_filter( 'bp_before_xprofile_cover_image_settings_parse_args', 'buddydev_set_default_profile_cover' );