You shouldn’t need to require anything since BP already loads it (if you have forums enabled).
You should be able to just grab the meta using one of the bbPress meta calls.
eg.
bb_get_postmeta(bp_get_the_topic_post_id(), $cachekey)
Make sure when grabbing the meta that you do a check to see if you’re on a forum post.
do_action( 'bbpress_init' );
This triggers BuddyPress to load the bbPress code. So as you’ve done, you need to call this early on. If it’s giving you the WSOD, you need to find out why and fix that.
that was my first thought but bb_get_option
and other functions are not defined if i’m trying to update some bb_option metadata from the bp dashboard side.
@DJPaul – probably my problem – i’ve tried so many hooks, so i’ll try and start over tonight.
etiviti – Does your external installation of bbPress store data in the same database as your buddypress install? If not I think you will need a new $wpdb class in order to specify the right database creds.
ok, so i narrowed the issue down to just /wp-admin/ only
function bp_forums_extras_setup_globals() {
do_action( 'bbpress_init');
}
add_action( 'bp_init', 'bp_forums_extras_setup_globals');
if i comment out do_action then /wp-admin/ loads up – otherwise WSOD. The action completes (calls function bp_forums_load_bbpress()
) but I guess something within WP conflicts?
sorry for the triple post but found the root problem.
Fatal error: Cannot redeclare checked() (previously declared in D:xampplitehtdocsbuddypresswp-contentpluginsbuddypressbp-forumsbbpressbb-adminincludesfunctions.bb-admin.php:1261) in D:xampplitehtdocsbuddypresswp-adminincludestemplate.php on line 387
and the fix…
function adminfix_adminfix_bbpress_init() {
global $bbdb, $bb_roles, $wp_roles;
if ( is_object( $bbdb ) && is_object( $bb_roles ) ) {
return;
}
if ( is_object( $bbdb ) ) {
$bb_roles =& $wp_roles;
bb_init_roles( $bb_roles );
return;
}
do_action( 'bbpress_init');
}
function bp_forums_extras_setup_globals() {
adminfix_adminfix_bbpress_init();
do_action('bp_forums_extras_init');
}
if (WP_ADMIN) {
add_action( 'admin_init', 'bp_forums_extras_setup_globals', 500 );
} else {
add_action( 'bp_init', 'bp_forums_extras_setup_globals', 5 );
}
Looking forward to your bbpress plugin ports! I tried doing it myself and soon ran up against my nearly complete lack of PHP skills….
Again: look in your logsand find out why the add_action is failing. That’s what you need to fix.
figured it out (see post above) – some reason in wp-admin mode $bb_roles
was getting wiped