Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/03/2010 10:33:18 PM (16 years ago)
Author:
apeatling
Message:

Fixes #2190 props wpmuguru

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-core.php

    r2981 r2982  
    20062006add_action( 'admin_notices', 'bp_core_activation_notice' );
    20072007
     2008/**
     2009 * bp_core_activate_site_options()
     2010 *
     2011 * When switching from single to multisite we need to copy blog options to
     2012 * site options.
     2013 *
     2014 * @package BuddyPress Core
     2015 */
     2016function bp_core_activate_site_options( $keys = array() ) {
     2017    global $bp;
     2018
     2019    if ( !empty( $keys ) && is_array( $keys ) ) {
     2020        $errors = false;
     2021
     2022        foreach ( $keys as $key => $default ) {
     2023            if ( empty( $bp->site_options[ $key ] ) ) {
     2024                $bp->site_options[ $key ] = get_blog_option( BP_ROOT_BLOG, $key, $default );
     2025
     2026                if ( !update_site_option( $key, $bp->site_options[ $key ] ) )
     2027                    $errors = true;
     2028            }
     2029        }
     2030
     2031        if ( empty( $errors ) )
     2032            return true;
     2033    }
     2034
     2035    return false;
     2036}
     2037
    20082038/********************************************************************************
    20092039 * Custom Actions
Note: See TracChangeset for help on using the changeset viewer.