开发者和设计师信息 BP 1.5

开发者和设计师信息 BP 1.5

Codex Home → Legacy Docs → Archived Section: Getting Started → Developer and Designer Information BP 1.5
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:
?1/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:
?12/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:
?1/wp-content/themes/YOUR-THEME/members/single/home.php
Open up /members/single/home.php in your editor and after:
?12    
Add:
?12    
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:
?1/wp-content/themes/YOUR-THEME/activity/entry.php
Open up entry.php and add the following snippet:
?1
Above or below:
?1
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:
?1/wp-content/themes/YOUR-THEME/groups/create.php
Open up create.php and find the following snippet:
?1
And replace it with:
?1
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:
?1/wp-content/themes/YOUR-THEME/registration/register.php
Open up register.php and remove the following block of code:
?1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950              

        

         

                    

         

                        <input type="submit" name="upload" id="upload" value="" />                        <input type="hidden" name="signup_email" id="signup_email" value="" />            <input type="hidden" name="signup_username" id="signup_username" value="" />        

                            

         <img src="" id="avatar-to-crop" class="avatar" alt="" />         

            <img src="" id="avatar-crop-preview" class="avatar" alt="" />        

         <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="" />         <input type="hidden" name="signup_email" id="signup_email" value="" />        <input type="hidden" name="signup_username" id="signup_username" value="" />        <input type="hidden" name="signup_avatar_dir" id="signup_avatar_dir" value="" />         <input type="hidden" name="image_src" id="image_src" value="" />                                               
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:
?1234567891011121314151617181920if ( !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:
?123456789101112function 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:
?12345
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

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注