Filters & Constants Reference
BudyPress provides a series of filters and constants you can add to your bp-custom.php or functions.php files to modify the behaviour of your BP install. These range from defining the avatar sizes BP will look for as defined defaults to filters that can be set to deactivate components fully such as @mentions
- Define default values for BP avatars – shown are the BP default values; ‘ORIGINAL_MAX_FILESIZE’ is a value generally taken from WP site settings.
define( 'BP_AVATAR_THUMB_WIDTH', 50 ); define( 'BP_AVATAR_THUMB_HEIGHT', 50 ); define( 'BP_AVATAR_FULL_WIDTH', 150 ); define( 'BP_AVATAR_FULL_HEIGHT', 150 ); define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 ); define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 );
- Force BP to display usernames with spaces
- Define the user account tab that is designated as the default to open with
define( 'BP_DEFAULT_COMPONENT', 'profile' )
- Do the same as user account screens default page for Groups.
define( 'BP_GROUPS_DEFAULT_EXTENSION', 'members' );
- Enabling this constant allows you remove the portion of the url path /members/ and have your member name at the ‘Root ‘ of the domain url.
define('BP_ENABLE_ROOT_PROFILES', true )
- Allow User screens to be viewed under the domain path of MS sub domains / sub directories N.B. As of 1.7 it is recommended not to define this constant as BP will activate on individual sites.
define( 'BP_ENABLE_MULTIBLOG', true );
BP functions are well specified with filters available for most of them, these are a few that are provided to act as simple switches.
- BP @-mention functionality is enabled by default If you don’t wish to use @-mentions, disable them completely.
add_filter( 'bp_activity_do_mentions', '__return_false' );
- BP by default converts certain strings in user profiles to links, to disable this behaviour add:
remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );