Skip to:
Content

BuddyPress.org

Changeset 2982


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

Fixes #2190 props wpmuguru

Location:
branches/1.2
Files:
3 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
  • branches/1.2/bp-loader.php

    r2892 r2982  
    6565        switch_theme( 'bp-default', 'bp-default' );
    6666
     67    /* Install site options on activation */
     68    bp_core_activate_site_options( array( 'bp-disable-account-deletion' => 0, 'bp-disable-avatar-uploads' => 0, 'bp-disable-blogforum-comments' => 0,  'bp-disable-forum-directory' => 0,  'bp-disable-profile-sync' => 0 ) );
     69
    6770    do_action( 'bp_loader_activate' );
    6871}
  • branches/1.2/bp-xprofile.php

    r2933 r2982  
    2828        $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
    2929
    30     if ( empty( $bp->site_options['bp-xprofile-base-group-name'] ) )
    31         update_site_option( 'bp-xprofile-base-group-name', 'Base' );
    32 
    33     if ( empty( $bp->site_options['bp-xprofile-fullname-field-name'] ) )
    34         update_site_option( 'bp-xprofile-fullname-field-name', 'Name' );
     30    bp_core_activate_site_options( array( 'bp-xprofile-base-group-name' => 'Base', 'bp-xprofile-fullname-field-name' => 'Name' ) );
    3531
    3632    $sql[] = "CREATE TABLE {$bp->profile->table_name_groups} (
Note: See TracChangeset for help on using the changeset viewer.