If you’re looking to integrate bbPress and WordPress, life just got a little easier.

Database Integration

Setting $bb->wp_table_prefix in bbPress’s config.php will tell bbPress to grab users and user meta data from those WordPress tables.

The CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE constants are still around and will override other settings if you need more fine grained control.

UPDATE: I should have mentioned Matt’s external user database update from a few months ago. It allows you to pull user and user meta information from a separate database. All you have to do is define USER_BBDB_NAME, USER_BBDB_USER, USER_BBDB_PASSWORD, and USER_BBDB_HOST.

If you’ve installed bbPress into a subdirectory of your WordPress installation, define $bb->wp_home and $bb->wp_siteurl as your WordPress blog address and WordPress address, respectively. Both sites will now share the same cookies so that when you’re logged into one, you’re logged into the other. (The addresses referenced above can be found in WordPress’ Options -> General admin tab.)

If bbPress is not installed in a subdirectory of your WordPress install, you’ll probably need to adjust both bbPress’ and WordPress’ cookies to meet your specific requirements. Below is a brief outline of the variables and constants that control the cookie behavior in the two programs.

PHP bbPress WordPress
name $bb->usercookie USER_COOKIE
name $bb->passcookie PASS_COOKIE
path $bb->cookiepath COOKIEPATH
path $bb->sitecookiepath SITECOOKIEPATH
domain $bb->cookiedomain COOKIE_DOMAIN

Registration Integration

Currently, when a user registers on your bbPress forum, your WordPress blog doesn’t know about it (and vice versa). The user will be created, but WordPress won’t know what user role to apply.

At the moment, integrating user registration more tightly will require a plugin both for bbPress and for WordPress. Hooks to look at include bbPress’ bb_new_user and bb_user_has_no_caps along with WordPress’ user_register.

Function Integration

bbPress keeps all of the code it has in common with WordPress in a couple of discrete files. If you’d like to load both bbPress and WordPress at the same time (so that you have access to both sets of functions and APIs), you’ll need to tell bbPress not to try and load functions and classes that WordPress has already defined.

Do so by defining WP_BB as true in either config.php or wp-config.php. Also, WordPress will have to be loaded first.

The short of it

We’re always trying to make things simpler around here. Integration with WordPress is easier now than it used to be but will hopefully continue to become more and more painless as we keep working.

As always, config-sample.php has a couple hints.