将 BuddyPress 样式添加到主题

将 BuddyPress 样式添加到主题

Codex Home → BuddyPress Theme Development → Theme Compatibility → Add BuddyPress Styles to a Theme
Add BuddyPress Styles to a Theme

BuddyPress 1.7 adds the ability to use any WordPress theme. The theme compatibility has a base style sheet that helps format the BuddyPress content. The styles may not be perfectly suited to your theme.
It』s very easy to add your own styles. If your theme folder has a sub folder called css you only need to add a stylesheet buddypress.css to this folder and BuddyPress will use this file overriding the BuddyPress styles. If the css folder is missing just create one and include the file inside. You can copy the buddypress.css file from the BuddyPress plugin folder and edit or create your own.
Theme Developer:
If you  want to ship your theme with extra styles to support BuddyPress add the BuddyPress styles to the buddypress.css file and include it in your theme. Do not add the BuddyPress styles to your style.css file. This will ensure the styles are only loaded when BuddyPress is activated and will override the default styles supplied by the plugin.
Prefix your styles with #buddypress to target the areas of BuddyPress content.
#buddypress .activity-content {

}
*NOTE As of 1.8 you can place the file in /my-theme/community/css/ or /my-theme/buddypress/css/

过滤器和常量参考

过滤器和常量参考

Codex Home → Developer Resources → Filters & Constants Reference
Filters & Constants Reference

BuddyPress Core Filters and Constants
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
Constants

Define default values for BP avatars – shown are the BP default values; 『ORIGINAL_MAX_FILESIZE』 is a value generally taken from WP site settings.

?123456define( '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

?1define('BP_ENABLE_USERNAME_COMPATIBILITY_MODE', true);

Define the user account tab that is designated as the default to open with

?1define( 'BP_DEFAULT_COMPONENT', 'profile' )

Do the same as user account screens default page for Groups.

?1define( '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. N.B. If you use BP_ENABLE_ROOT_PROFILES there might be a situation where some user profiles get the same url as some posts or pages rendering either of them inaccessible. This might also be true of sub-sites if you』re running multisite with subdirectories. See ticket #1426 for more information.

?1define('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.

?1define( 'BP_ENABLE_MULTIBLOG', true );

Enable private messaging to all users

By default you can only send private messages to people in your friends list, to change this behaviour you can add this constant to your wp-config.php or bp-custom.php file
?1define( 'BP_MESSAGES_AUTOCOMPLETE_ALL', true );

If you do allow this please consider that it allows possible spamming of you members , this is why if only friends can PM it』s by consent.

Filters
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.

?1add_filter( 'bp_activity_do_mentions', '__return_false' );

BP by default converts certain strings in user profiles to links, to disable this behaviour add:

?1remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );

Admin Bar: Since BP 1.6 the default behaviour has been to use the WP adminbar for BP related links deprecating the older BP buddybar

You may alter this behaviour and return to using the older style buddybar by adding this filter
?1add_filter('bp_use_wp_admin_bar', __return_false);

bp_load_theme_functions()

bp_load_theme_functions()

Codex Home → Developer Resources → Function Examples → bp_load_theme_functions()
bp_load_theme_functions()

function bp_load_theme_functions() {
global $pagenow;

// Do not include on BuddyPress deactivation
if ( bp_is_deactivation() )
return;

// Only include if not installing or if activating via wp-activate.php
if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) {
bp_locate_template( 'buddypress-functions.php', true );
}
}

If you need to stop BuddyPress from loading the buddypress-functions.php file use the remove action below. This is useful if you are supplying functions with your custom BuddyPress theme that may interfere with the core functions.
remove_action( 'bp_after_setup_theme', 'bp_load_theme_functions', 1 );

Source File
bp_load_theme_functions() is located in bp-core/bp-core-template-loader.php

群组 (Groups)

群组 (Groups)

Codex Home → Administrator Guide → Groups
Groups

Groups in BuddyPress are gatherings of members, posts, and any other user-generated content. A member can create a group in BuddyPress (if enabled by Super/Site Admin) and thus becomes the group administrator. Every group includes a Status Update form for members and the latest group news which can be kept up to date by group admins. Group admins can also approve requests to join the private group, invite friends to congregate within a hidden group, establish communications among members, extend privileges to other members, and enable new features (Group Forums if enabled by Super Admin) within the group, among others.
Sections

Groups Directory
Single Group

Group Header
Activity (group home page)
Members
Send Invites
Admin

Groups Directory
Groups Directory Page. Click on image to enlarge.
Sections
Create a Group button/link – Shown beside the Groups page title to logged in member if the Site/Super Admin has enabled group creation by members.
Search Groups search form
All Groups – with total number of registered users who have logged in at least once after BuddyPress was activated in the installation.
Selectbox – Show: Last Active (default), Most Members, Newly Created, or Alphabetical
List of Groups created in the site including time active stamp, group description, number of members and group privacy setting. Only Public and Private Groups are seen in list by regular members. Super/Site Admin sees all groups including Hidden groups.
Action buttons – for logged in members only
Join Group button – for groups listed as Public, button visible to logged in members only.
Request Membership button – for groups listed as Private, button is visible to logged in members only.
( Membership in Hidden groups is by invitation only.)

My Groups – for logged in users only. This includes a counter of the total number of groups you have created and/or joined in
Options
Selectbox – Show: Last Active (default), Most Members, Newly Created, or Alphabetical
List of Groups you are a member of – Public, Private and Hidden (only by you and Super Admin)
Leave Group button – visible to logged in members of Public, Private and Hidden Groups. You cannot leave the group if you are the only Group Admin.

Single Group Header
Single Group Header. Click on image to enlarge.
Sections
Group Avatar or Site Default Avatar
Group Name
Group Description
Group Admin/s with avatar/s
Group Mod/s (if any) with avatar/s
Join Group button (for a Public group) or Request Membership button (for a Private Group) or Leave Group button (for Public, Private or Hidden Group)

Home Page
The Group』s Activity Stream is the default Home tab for any group.
Sections
RSS feed
Selectbox: Show: Everything (default), Updates, Group Memberships
Status Update – visible to all logged in group members only
Options
Text Area box
Post In – Selectbox: Member』s Profile Page or to one of Membes』s Groups
Post Update button

List of Group activities. Following buttons/links are visible to logged in group members only
Options
Comment button
Reply to Comment link
Favorite button or Remove Favorite button
Delete button – visible only to Group Admin, Group Moderator and Super/Site Admin.

Members
List of Group Members
Sections
Member Avatar
Member Nice Name
Member Active Since
Action buttons
Options
Add Friend (friendship request) button – visible to logged in group members
Cancel Friendship Request button – visible to the group member who made the friendship request
Cancel Friendship button – visible to the group member whose friendship request was accepted
Favorite button or Remove Favorite button

Send Invites
Visibility of Send Invites link to members or Group Mod/s is dependent on what option the Group Admin chose in Admin > Settings > Group Invitations: All group Members, Group Admins and Mods only, or Group admins only.
Options
Info: Select people to invite from your friends list.
List of your friends with checkbox beside each name is shown in panel.
Select friend and the friend is automatically listed in invite list.
Remove Invite button – click to remove friend/s from list prior to sending invitation
Send Invites button – click to send invitation/notification to one or group of friend/s

Admin
Tab/link is visible only to Group Admin and Super/Site Admin
Sections
Details
Options
Group Name (required) text area
Group Description (required) text area
Notify group members of changes via email – Yes or No option
Save Changes button

Settings
Group Admin Settings Panel. Click on image to enlarge
Privacy Options – Group Admin selects from among three options (About Group Privacy Options)
Options
This is a public group
Options
Any site member can join this group.
This group will be listed in the groups directory and in search results.
Group content and activity will be visible to any site member.

This is a private group
Options
Only users who request membership and are accepted can join the group.
This group will be listed in the groups directory and in search results.
Group content and activity will only be visible to members of the group.

This is a hidden group
Options
Only users who are invited can join the group.
This group will not be listed in the groups directory or search results.
Group content and activity will only be visible to members of the group.

Group Invitations – select which members of this group are allowed to invite others?
Options
All group members
Group admins and mods only
Group admins only

Save Changes button

Avatar
Options
Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results.- .jpg, .gif or .png format

Choose File button (no file chosen)
Upload Image button

If you』d like to remove the existing avatar but not upload a new one, please use the delete avatar button.

Delete Avatar button

Members
Group Admin > Members (group roles). Click to enlarge.

List of members according to member』s role in group – visible to Group Admin and Super/Site Admin only. (About Group Roles).

Administrator/s – If there』s only one Group Admin, there will be no button to demote or remove the user as there must always be a group admin position.
Option
Demote to Member button – Shows up only if there』s more than one Group Admin

Moderator/s
Options
Promote to Admin button
Demote to Member button

Member/s
Options
Kick & Ban button
Promote to Mod button
Promote to Admin button
Remove from Group button

Delete

WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option.
Checkbox: I understand the consequences of deleting this group.
Delete Group button

Groups Management Panels
Groups Dashboard Admin. Click on image to enlarge.
BuddyPress provides admin dashboard panels to help you manage the Groups created in your site, including membership and settings(added in BuddyPress 1.7).
Sections
General Type
Options
All
Public
Private
Hidden

Bulk Actions: Delete (Apply) Groups Network-Multisite Admin Dashboard. Click on image to enlarge.
Search All Groups form
Pagination
List of All Groups
Columns
Name: Avatar and Group Name
Options
Visit: Goes to Group』s home page in the front end of the site
Edit: Opens up a new Group Management panel in dashboard to edit the Group
SectionsEdit Group panel. Click on image to enlarge.
Name and Description
Inputs
Name of Group
Text area for Description of Group

Add New Members
Input
Start typing a username to add a member

Manage Members
Types
Administrators
Columns
ID: User ID Number
Name: Avatar and Username which link to the Member』s Activity > Personal page in frontend
Group Role
Selectbox
Administrator (default)
Moderator
Member
Banned
Remove from Group (Member cannot be removed if said member is the only Group Administrator)

Moderators: Either 「No members of this type」 if there is no Group Mod or
Columns
ID: User ID Number
Name: Avatar and Username which link to the Member』s Activity > Personal page in frontend
Group Role
Selectbox
Administrator
Moderator (default)
Member
Banned
Remove from Group

Members: Either 「No members of this type」 if there are no members yet or
Columns
ID: User ID Number
Name: Avatar and Username which link to the Member』s Activity > Personal page in frontend
Group Role
Selectbox
Administrator
Moderator
Member (default)
Banned
Remove from Group

Banned Users Either 「No members of this type」 if there is no banned user or
Columns
ID: User ID Number
Name: Avatar and Username which link to the Member』s Activity > Personal page in frontend
Group Role
Selectbox
Administrator
Moderator
Member
Banned (default)
Remove from Group

Save
Options
Delete Group link
Save Changes button

Settings
Elements
Checkbox: Enable discussion forum (if bbPress plugin is activated and Group Forums are enabled in bbPress Settings page)
Privacy
Options
Public (default)
Private
Hidden

Who can invite others to this group?
Options
All group members (default)
Group admins and mods only
Group admins only

Delete: Opens up the Delete Groups panel in dashboard
Elements Delete Group/s panel in dashboard.
You are about to delete the following groups:
List of Group/s to be deleted
This action cannot be undone. (warning)
Delete Permanently button or Cancel button

Description
Status: Private, Public or Hidden
#Members: Number of members and Sorting of groups by number of members
Last Active: Date and Time

群组扩展 API(旧版)

群组扩展 API(旧版)

Codex Home → Legacy Docs → Archived Section: Developer Resources → Group Extension API (legacy)
Group Extension API (legacy)

Archived file. Good only up to BP 1.7 version

Note: This guide is for use with versions of BuddyPress older than 1.8. In BP 1.8, the group extension API was rewritten. Plugins written as described below should continue to work, but for new projects you are highly encouraged to use the 1.8+ methods described on the main Group Extension API Codex page.
The group extension API (1.1+) makes it very easy to add custom creation steps, edit screens, navigation items and pages to a group. It essentially allows you to create fully functional extensions to BuddyPress created groups.
Note: If you are building a BuddyPress plugin, please make sure you have read how to check if BuddyPress is active. This is very important.
Note: The admin_screen() and admin_screen_save() methods are new in BuddyPress 1.7. On earlier versions of BP, they won』t do anything.
The API Syntax
A group extension could be created as a standalone plugin file, or included as code within a plugin that performs other tasks. The core API code is as follows:
if ( bp_is_active( 'groups' ) ) : // Recommended, to prevent problems during upgrade or when Groups are disabled

class My_Group_Extension extends BP_Group_Extension {

function __construct() {
$this->name = 'My Group Extension';
$this->slug = 'my-group-extension';

$this->create_step_position = 21;
$this->nav_item_position = 31;
}

/**
* The content of the My Group Extension tab of the group creation process
*
* Don't need a group creation step? In the __construct() method:
*
* $this->enable_create_step = false;
*/
function create_screen() {
if ( !bp_is_group_creation_step( $this->slug ) )
return false;

/**
* If your extension's Create step shares much of its code with
* its Edit step, you might consider putting shared markup into
* a separate method (such as edit_create_markup()), and then
* call the method here:
*
* $this->edit_create_markup();
*/
?>

The HTML for my creation step goes here.

slug );
}

/**
* The routine run after the user clicks Continue from your creation step
*
* You'll be pulling your data out of the $_POST global. Be sure to
* sanitize as necessary.
*/
function create_screen_save() {
global $bp;

check_admin_referer( 'groups_create_save_' . $this->slug );

/* Save any details submitted here */
groups_update_groupmeta( $bp->groups->new_group_id, 'my_meta_name', 'value' );
}

/**
* The content of the My Group Extension tab of the group admin
*/
function edit_screen() {
if ( !bp_is_group_admin_screen( $this->slug ) )
return false; ?>

name ) ?>

Edit steps here

slug );
}

/**
* The routine run after the user clicks Save from your admin tab
*
* You'll be pulling your data out of the $_POST global. Be sure to
* sanitize as necessary.
*/
function edit_screen_save() {
global $bp;

if ( !isset( $_POST['save'] ) )
return false;

check_admin_referer( 'groups_edit_save_' . $this->slug );

/* Insert your edit screen save code here */

/* To post an error/success message to the screen, use the following */
if ( !$success )
bp_core_add_message( __( 'There was an error saving, please try again', 'buddypress' ), 'error' );
else
bp_core_add_message( __( 'Settings saved successfully', 'buddypress' ) );

bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/admin/' . $this->slug );
}

/**
* Use this function to display the actual content of your group extension when the nav item is selected
*/
function display() {
?>

Welcome to my cool group extension!

The HTML for my admin panel.

name ) ?>

You could display a small snippet of information from your group extension here. It will show on the group
home screen.

enable_nav_item = $this->enable_nav_item();

/* Add this method the end of your extension class */
function enable_nav_item() {
global $bp;

/* You might want to check some groupmeta for this group, before determining whether to enable the nav item */
if ( groups_get_groupmeta( $bp->groups->current_group->id, 'settings_complete' ) )
return true;
else
return false;
}

bp_profile_field_data()

bp_profile_field_data()

Codex Home → Developer Resources → Function Examples → bp_profile_field_data()
bp_profile_field_data()

Description
Takes a field name and outputs its corresponding field value. Can be specified by user ID.
Usage
$args = array(
'field' => 'Field Name',
'user_id' => 1
);
bp_profile_field_data( $args );

Parameters

field
(string) Name of profile field to retrieve. The default is false

user_id
(integer) Display field corresponding to a specific user. If no parameter is used, it defaults to bp_displayed_user_id()

Example
To get the current user』s 『Birthday』:
bp_profile_field_data( 'field=Birthday' );
To get User 4』s 『Hire Date』:
bp_profile_field_data( 'field=Hire Date&user_id=4' );
Source File
bp_profile_field_data() is located in bp-xprofile/bp-xprofile-template.php

活动流 (Activity Streams)

活动流 (Activity Streams)

Codex Home → Administrator Guide → Activity Streams
Activity Streams

Activity streams aggregate all of your activities across a BuddyPress installation.
Enabled BuddyPress components make use of the activity stream component, which means any sort of activity can be recorded. Blogs posts, new friendships and blog comments are among the most popular activities recorded. Furthermore, custom components can also hook into the activity streams, meaning any sort of data can be tracked and recorded.
Following are the the pages rendered in the front end of your site when the Activity Component is activated.

Sitewide Activity Stream
Member Activity Stream
and if the Groups Component is active:
Group Activity Stream

Sitewide Activity Stream
Shows all activities throughout the site or network (if multisite)
Sitewide Activity Stream on BP Default Theme. Click on image to enlarge.
Sections
RSS feed
Selectbox: Show: Everything (default), Updates, Posts, Comments, New Groups, Group Memberships, Friendships, New Members
Status Update – visible to all logged in members only

Text Area box
Post In – Selectbox: Member』s Profile Page or to one of Membes』s Groups
Post Update button

Following buttons/links are visible to logged in members only

Comment button
Reply to Comment link
Favorite button or Remove Favorite button
Delete button – visible only to Super/Site Admin.

Member Activity Stream
Shows the Member』s activities throughout the site.
Sections Member Activity Stream on Twenty Twelve Theme. Click on image to enlarge.
Personal – Shows your activities throughout the site. The status update form and following buttons are visible for logged-in members only.

Selectbox – Show: Everything (default), Updates, Posts, Comments, Friendships, New Groups, or Group Memberships
Status Update – visible to all logged in members only

Text Area box
Post In – Selectbox: Member』s Profile Page or to one of Membes』s Groups
Post Update button

Comment button
Reply to Comment link
Favorite button or Remove Favorite button
Delete button

Mentions – Shows a list of all @mentions for you. The following buttons are visible for logged-in members only.

Selectbox – Show: Everything (default), Updates, Posts, Comments, Friendships, New Groups, or Group Memberships
Comment button
Reply to Comment link
Favorite button or Remove Favorite button

Favorites – Shows a list of all items you clicked as 「Favorite」. The following buttons are visible to the member only.

Selectbox – Show: Everything (default), Updates, Posts, Comments, Friendships, New Groups, or Group Memberships
Comment button
Reply to Comment link
Favorite button or Remove Favorite button
Delete button

Friends – Shows Activity Streams of your friends. The following buttons are visible for logged-in members only.

Selectbox – Show: Everything (default), Updates, Posts, Comments, Friendships, New Groups, or Group Memberships
Comment button
Reply to Comment link
Favorite button or Remove Favorite button

Groups – Shows the Activity Streams of the groups you』ve joined. The following buttons are visible to the member only.

Selectbox – Show: Everything (default), Updates, New Groups, or Group Memberships
Comment button
Reply to Comment link
Favorite button or Remove Favorite button

Group Activity Stream
Shows the specific Group』s Activity Stream which is the default Home tab for any group.
Group Activity Stream on the Twenty Thirteen Theme. Click on image to enlarge.
Sections
RSS feed
Selectbox: Show: Everything (default), Updates, Group Memberships
Status Update – visible to all logged in members only

Text Area box
Post In – Selectbox: Member』s Profile Page or to one of Membes』s Groups
Post Update button

Following buttons/links – visible to logged in group members only

Comment button
Reply to Comment link
Favorite button or Remove Favorite button
Delete button – visible only to Group Admin, Group Moderator and Super/Site Admin.

⇒ Related: Activity Stream Management Screens

检查插件或主题中的活动组件

检查插件或主题中的活动组件

Codex Home → Developer Resources → Checking for Active Components in Plugins or Themes
Checking for Active Components in Plugins or Themes

BuddyPress plugins (and sometimes themes), in order to extend (or display the content of) BuddyPress components generally use their hooks, their functions, template tags or even template parts. In order to avoid errors, it』s even more important to check for active components in BuddyPress 1.7.
On a fresh install, version 1.7 only activates the Activity Streams and the Extended Profiles components. I think it』s a very interesting move because it shows the site administrator that BuddyPress is a set of components he can activate or not in order to build his very own BuddyPress powered community.
It』s also requiring plugin or theme authors to be more vigilant than before as when running the installation wizard most site administrators used to simply hit the button 「Save & Next」 leaving all the components activated.
So to prevent errors, i think it』s important we (it』s also a note to myself) check that the component is active when we』re planning to extend its behavior or when we just need to use one of its functions.
bp_is_active
To do so, since version 1.5, we can use the bp_is_active() function. It』s located in the /bp-core/bp-core-template.php file at line 1072 (in 1.7-beta1) and needs one parameter : the component identifier. This function uses the global $bp in order to return true or false depending on whether the component is active or not.
Here』s the list of the different identifiers :

Extended Profiles = 『xprofile』
Account Settings = 『settings』
Friend Connections = 『friends』
Private Messaging = 『messages』
Activity Streams = 『activity』
User Groups = 『groups』
Group Forums = 『forums』
Site Tracking = 『blogs』

Examples of use
If for some reason we want to display a particular member』s profile field, let』s check the Extended Profiles component is active.
if ( bp_is_active( 'xprofile' ) )
$fullname = xprofile_get_field_data( 1, $user_id );

If our plugin needs to deal with user settings to allow members to customize its options, it can add a new sub navigation item to the user settings navigation. If it doesn』t check if the User Settings component is enabled, it will cause a white screen of death on the front end and on the back end!!
if( bp_is_active( 'settings' ) {
bp_core_new_subnav_item( array( 'name' => __( 'BP Plugin User Settings', 'bp-checkins' ),
'slug' => 'bp-plugin-user-settings',
'parent_slug' => bp_get_settings_slug(),
'parent_url' => trailingslashit( bp_loggedin_user_domain() . bp_get_settings_slug() ),
'screen_function' => 'bp_plugin_screen_settings_menu',
'position' => 40,
'user_has_access' => bp_is_my_profile()
) );
}

If we plan to build a widget to display the friends of the logged in or the displayed user, let』s not forget to check the site administrator activated the Friends component.
function bp_show_friends_register_widgets() {
if( bp_is_active( 'friends' ) )
add_action('widgets_init', create_function('', 'return register_widget("BP_Show_Friends_Widget");') );
}
add_action( 'bp_register_widgets', 'bp_show_friends_register_widgets' );

A theme can choose to display the number of unread private messages of the logged in member in its header. Again, it needs to check if the component is active, or else, after its header, no more content will be displayed.

<a href="">

Our plugin may need to take benefit of the Activity Streams component, so before recording a new activity, we should check it』s available.
if( bp_is_active('activity') )
bp_activity_add( $args );

If our plugin needs to use the Group Extension API, we should first check the User Groups component is active.
class BP_Plugin_Component extends BP_Component {

function __construct() {}
function includes() {
// Files to include
$includes = array(
'includes/bp-plugin-functions.php',
'includes/bp-plugin-templatetags.php'
);

/* includes the Group API only if...
...the User Groups component is available */

if( bp_is_active( 'groups' ) )
$includes[] = 'includes/bp-plugin-group-class.php';
}
function setup_globals() {}
function setup_nav() {}
function setup_admin_bar() {}
}

function bp_plugin_load_core_component() {
global $bp;
$bp->bp_plugin = new BP_Plugin_Component;
}
add_action( 'bp_loaded', 'bp_plugin_load_core_component' );

A theme can include a template to customize the functionality of the blog home page by adding an area to display the latest group forum topics. Here, we definitely need to check for the BuddyPress forum component as it will be soon possible to use bbPress 2.3 to power group forums. The error can confuse the site administrator as he won』t understand why he gets an error as the forum of his groups are working great.

If our plugin requires a component or more to be active to run, we can catch the admin_notices hook to invite the site administrator to activate the needed component(s) that his config is missing, i』ve found these interesting lines in BuddyPress Courseware.
function bpsp_check() {
/* beginning of extract */

foreach( array( 'groups', 'activity', 'xprofile', 'forums', 'messages' ) as $c )
if( !bp_is_active( $c ) )
$messages[] = sprintf(
__( 'BuddyPress Courseware dependency error: %2$s has to be activated!', 'bpsp' ),
admin_url( 'admin.php?page=bp-general-settings' ),
$c
);

/* end of extract */
}

add_action('admin_notices', 'bpsp_check' );

自动化测试

自动化测试

Codex Home → Developer Resources → Automated Testing
Automated Testing

BuddyPress contains a suite of automated tests. These tests are designed to prevent the accidental introduction – or reintroduction – of bugs. If you are a developer of BuddyPress plugins, or if you are contributing to BuddyPress core, please consider using (and writing!) these tests.
The BuddyPress test system is based on, and uses, the WordPress suite. Before getting started, you are encouraged to read more about how WordPress tests work.
Installation

Set up the WordPress test suite. You』ll need to install PHPUnit, check out the WordPress core test repository, create a blank MySQL database, and set up your wp-tests-config.php file. Follow the instructions in the WordPress contributor handbook to get set up. The WordPress test suite can be located anywhere on your development machine, though it』s recommended that you place it somewhere outside your normal WordPress/BuddyPress development environment.
Check out the BuddyPress Subversion repository. At the moment, we do not plan to distribute the test suite with the .zip download of BuddyPress. To use the BuddyPress test suite, you』ll need to check out BuddyPress trunk from buddypress.trac.wordpress.org.
$ svn co https://buddypress.svn.wordpress.org/trunk buddypress
Please note that your checkout of BuddyPress trunk must be at or beyond revision 6908.
Define WP_TESTS_DIR in your bash profile (optional). The test suite requires an environment variable WP_TESTS_DIR that defines the location of your checkout of the WordPress tests. While it』s possible to define the environment variable each time you run the tests, ie, WP_TESTS_DIR=~/sites/tests/phpunit and then export using export WP_TESTS_DIR, you』ll probably find it useful to set the variable permanently in your bash profile. On OS X or Linux, add the following line to ~/.bashrc:
export WP_TESTS_DIR="/home/bgorges/sites/tests/phpunit"
(changing the path to wherever you installed the WP tests in step 1). To apply these changes, source ~/.bashrc.

Running the tests
Navigate to the tests subdirectory of the BuddyPress plugin folder, and type phpunit. (If you didn』t add WP_TESTS_DIR to your bash profile in step 3 above, you』ll need to define that environment variable inline.) Then:
$ phpunit

BP-Default 默认主题版本

BP-Default 默认主题版本

Codex Home → Legacy Docs → Archived Section: Theme Development → The BuddyPress Default Theme → BP-Default Theme Versions
BP-Default Theme Versions

Archived file. The BP Default theme will no longer be activated in new installations and will be retired in the near future. http://bpdevel.wordpress.com/2013/11/13/the-future-of-the-bp-default-theme/

Past versions of BP-Default BuddyPress Theme.
1.5.6 (svn)
1.5.5 (svn)
1.5.4 (svn)
1.5.3.1 (svn)
1.5.3 (svn)
1.5.2 (svn)
1.5.1 (svn)
1.5 (svn)
1.2.10 (svn)
1.2.9 (svn)
1.2.8 (svn)
1.2.7 (svn)
1.2.6 (svn)
1.2.5.2 (svn)
1.2.5.1 (svn)
1.2.5 (svn)
1.2.4.1 (svn)
1.2.4 (svn)
1.2.3 (svn)
1.2.2 (svn)
1.2.1 (svn)
1.2 (svn)
1.1.3 (svn)
1.1.2 (svn)
1.1.1 (svn)
1.1 (svn)
1.0.3 (svn)
1.0.2 (svn)
1.0.1 (svn)
1.0 (svn)