Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)
  • @mihaimihai

    Member

    In bb-core.php -> bp_core_get_site_options()

    if ( bp_core_is_multisite() )
    $meta = $wpdb->get_results( "SELECT meta_key AS name, meta_value
    AS value FROM {$wpdb->sitemeta} WHERE meta_key IN ({$meta_keys})" );...

    buddypress doesn’t seem to be checking for the site id – so if you have multiple sites defined (on different domains) you can get incorrect results.

    Fixed this in my MU install by adding this filter

    add_filter('bp_core_get_site_options', 'bp_tweaks_bp_core_get_site_options');
    function bp_tweaks_bp_core_get_site_options($options){
    global $wpdb;
    $option_names = array_unique(array_keys($options));
    $option_values = $wpdb->get_results("
    SELECT meta_key, meta_value FROM {$wpdb->sitemeta}
    WHERE site_id={$wpdb->siteid}
    AND meta_key IN ('".join("','", $option_names)."');
    ");
    foreach($option_values as $v){
    $options[$v->meta_key] = $v->meta_value;
    }
    return $options;
    }

Viewing 1 replies (of 1 total)
Skip to toolbar