Developer and Designer Information BP 1.5
Archived file. Good up to BP 1.5 version
As with any release developers and designers may need extra information so here is a collection of links around the new release.
BuddyPress 1.5.2 and WordPress 3.3
Use wp_enqueue_scripts, not wp_print_styles, to enqueue scripts and styles for the frontend
BuddyPress 1.5 and WordPress 3.2.1
Plugin update information : Boone B Gorges
Better Metadata wrappers : Boone B Gorges
Accessing User metadata : Boone B Gorges
Does your BuddyPress plugin or theme modify BP’s navigation menus? : Boone B Gorges
Maintain Backward Compatibility with an abstraction file: Boone B Gorges
Custom Post Types Comments and the Activity Stream in bp 1.5 : Boone B Gorges
Manually modifying single group navigation in BuddyPres 1.5 : Boone B Gorges
Fix your older plugin to be compatible with BP 1.5: BuddyPress Media Dev team
Theme information:
Member settings pages are blank
BuddyPress 1.5 comes with brand-new templates so you can style your member settings pages. However, if you’re using an older child theme, you will need to copy over these templates to your WP theme.
To fix this problem, copy over the following folder:
/plugins/buddypress/bp-themes/bp-default/members/single/settings/
directly to your WP theme’s folder.
Member forum pages are blank
BuddyPress 1.5 ships with a brand new member sub-nav item called “Forums” where members can find the topics they have started or replied to.
Example:
http://testbp.org/members/johnjamesjacoby/forums
For this to function properly in older child themes, you’ll need to copy over the following files and folders:
/plugins/buddypress/bp-themes/bp-default/members/single/forums.php /plugins/buddypress/bp-themes/bp-default/members/single/forums/
directly to your WP theme’s folder.
You’ll also need to modify the following file in your WP theme:
/wp-content/themes/YOUR-THEME/members/single/home.php
Open up /members/single/home.php in your editor and after:
<?php elseif ( bp_is_user_profile() ) : ?> <?php locate_template( array( 'members/single/profile.php' ), true ) ?>
Add:
<?php elseif ( bp_is_user_forums() ) : ?> <?php locate_template( array( 'members/single/forums.php' ), true ) ?>
Activity entries are missing the “Delete” button
BuddyPress 1.5 changed the way the “Delete” button is rendered in activity entry items.
In older child themes, you will need to modify the activity entry template located in:
/wp-content/themes/YOUR-THEME/activity/entry.php
Open up entry.php and add the following snippet:
<?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?>
Above or below:
<?php do_action( 'bp_activity_entry_meta' ); ?>
Now you can delete activity entries again!
Group avatar uploading doesn’t work
BuddyPress 1.5 changed a bit of code in the group creation template that broke compatibility with older themes.
For compatibility, you will need to modify the group creation template located in:
/wp-content/themes/YOUR-THEME/groups/create.php
Open up create.php and find the following snippet:
<?php if ( !bp_get_avatar_admin_step() ) : ?>
And replace it with:
<?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
You should now be able to upload group avatars again!
Avatar uploading doesn’t work on the registration page
In BuddyPress 1.5, the ability to upload an avatar was removed from the registration page.
In older child themes, you should remove a section of code in the registration template located in:
/wp-content/themes/YOUR-THEME/registration/register.php
Open up register.php and remove the following block of code:
<?php if ( bp_is_active( 'xprofile' ) && !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?> <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?> <h4><?php _e( 'Your Current Avatar', 'buddypress' ) ?></h4> <p><?php _e( "We've fetched an avatar for your new account. If you'd like to change this, why not upload a new one?", 'buddypress' ) ?></p> <div id="signup-avatar"> <?php bp_signup_avatar() ?> </div> <p> <input type="file" name="file" id="file" /> <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ) ?>" /> <input type="hidden" name="action" id="action" value="bp_avatar_upload" /> <input type="hidden" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" /> <input type="hidden" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" /> </p> <?php wp_nonce_field( 'bp_avatar_upload' ) ?> <?php endif; ?> <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?> <h3><?php _e( 'Crop Your New Avatar', 'buddypress' ) ?></h3> <img src="<?php bp_avatar_to_crop() ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ) ?>" /> <div id="avatar-crop-pane"> <img src="<?php bp_avatar_to_crop() ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ) ?>" /> </div> <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ) ?>" /> <input type="hidden" name="signup_email" id="signup_email" value="<?php bp_signup_email_value() ?>" /> <input type="hidden" name="signup_username" id="signup_username" value="<?php bp_signup_username_value() ?>" /> <input type="hidden" name="signup_avatar_dir" id="signup_avatar_dir" value="<?php bp_signup_avatar_dir_value() ?>" /> <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src() ?>" /> <input type="hidden" id="x" name="x" /> <input type="hidden" id="y" name="y" /> <input type="hidden" id="w" name="w" /> <input type="hidden" id="h" name="h" /> <?php wp_nonce_field( 'bp_avatar_cropstore' ) ?> <?php endif; ?> <?php endif; ?>
Stylesheet changes
BuddyPress Default uses a function to enqueue it’s stylesheets in BuddyPress 1.5. Our “Building a Child Theme” codex article has been updated for BP 1.5 and reflects the information posted below.
The function you want to be interested in is this:
if ( !function_exists( 'bp_dtheme_enqueue_styles' ) ) : /** * Enqueue theme CSS safely * * @see https://codex.wordpress.org/Function_Reference/wp_enqueue_style * @since 1.5 */ function bp_dtheme_enqueue_styles() { // Bump this when changes are made to bust cache $version = '20110804'; // Default CSS wp_enqueue_style( 'bp-default-main', get_template_directory_uri() . '/_inc/css/default.css', array(), $version ); // Right to left CSS if ( is_rtl() ) wp_enqueue_style( 'bp-default-main-rtl', get_template_directory_uri() . '/_inc/css/default-rtl.css', array( 'bp-default-main' ), $version ); } add_action( 'wp_enqueue_scripts', 'bp_dtheme_enqueue_styles' ); endif;
All you need to do is declare that in your child theme as it has a check to see if exists it will then use your function so no need to deregister.
In your functions.php declare the function like this:
function bp_dtheme_enqueue_styles() { // Bump this when changes are made to bust cache $version = '20110804'; // Default CSS wp_enqueue_style( 'bp-default-main', get_template_directory_uri() . '/_inc/css/default.css', array(), $version ); // Right to left CSS if ( is_rtl() ) wp_enqueue_style( 'bp-default-main-rtl', get_template_directory_uri() . '/_inc/css/default-rtl.css', array( 'bp-default-main' ), $version ); } add_action( 'wp_enqueue_scripts', 'bp_dtheme_enqueue_styles' );
If you want no styles enqueued you can just call it empty like this:
<?php if ( !function_exists( 'bp_dtheme_enqueue_styles' ) ) : function bp_dtheme_enqueue_styles() {} endif; ?>
Alternatively if you anted to add in your own styles you can simply enqueue them after the default or even instead of the default.
You can also do the same for scripting and other functions in the BuddyPress Default’s functions.php.
BuddyPress Template Pack Tutorials for BP 1.5
Twenty Eleven theme – https://codex.buddypress.org/theme-development/theme-dev-bp-template-pack-walkthrough-twenty-eleven-bp-1-5/ by mercime
Twenty Ten Theme – https://codex.buddypress.org/theme-development/theme-dev-bp-template-pack-walkthrough-twenty-ten-bp-1-5/ by mercime