Skip to:
Content

BuddyPress.org

Ticket #2190: 2190.diff

File 2190.diff, 2.3 KB (added by wpmuguru, 15 years ago)
  • bp-core/bp-core-wpabstraction.php

     
    8989                return true;
    9090        }
    9191}
     92
     93function bp_activate_site_options( $keys = array() ) {
     94        global $bp;
     95        if ( !empty( $keys ) && is_array( $keys ) ) {
     96                foreach ( $keys as $key => $default ) {
     97                        if ( empty( $bp->site_options[ $key ] ) ) {
     98                                $bp->site_options[ $key ] = get_blog_option( BP_ROOT_BLOG, $key, $default );
     99                                update_site_option( $key, $bp->site_options[ $key ] );
     100                        }
     101                }
     102        }
     103}
  • bp-loader.php

     
    6464        if ( 'bp-sn-parent' == get_blog_option( BP_ROOT_BLOG, 'template' ) && 'bp-default' == get_blog_option( BP_ROOT_BLOG, 'stylesheet' ) )
    6565                switch_theme( 'bp-default', 'bp-default' );
    6666
     67        bp_activate_site_options( array( 'bp-disable-account-deletion' => '0', 'bp-disable-avatar-uploads' => '0',
     68                'bp-disable-blogforum-comments' => '0',  'bp-disable-forum-directory' => '0',  'bp-disable-profile-sync' => '0' ) );
     69
    6770        do_action( 'bp_loader_activate' );
    6871}
    6972register_activation_hook( 'buddypress/bp-loader.php', 'bp_loader_activate' );
     
    8790}
    8891register_deactivation_hook( 'buddypress/bp-loader.php', 'bp_loader_deactivate' );
    8992
    90 ?>
    91  No newline at end of file
     93?>
  • bp-xprofile.php

     
    2727        if ( !empty($wpdb->charset) )
    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' );
     30        bp_activate_site_options( array( 'bp-xprofile-base-group-name' => 'Base', 'bp-xprofile-fullname-field-name' => 'Name' ) );
    3231
    33         if ( empty( $bp->site_options['bp-xprofile-fullname-field-name'] ) )
    34                 update_site_option( 'bp-xprofile-fullname-field-name', 'Name' );
    35 
    3632        $sql[] = "CREATE TABLE {$bp->profile->table_name_groups} (
    3733                          id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
    3834                          name varchar(150) NOT NULL,