Skip to:
Content

BuddyPress.org

Ticket #3661: 3661.02.patch

File 3661.02.patch, 2.3 KB (added by DJPaul, 9 years ago)
  • bp-core/admin/bp-core-settings.php

    function bp_admin_setting_callback_account_deletion() { 
    4949<?php
    5050}
    5151
     52/**
     53 * If user has upgraded to 1.6 and chose to retain their BuddyBar, offer then a switch to change over
     54 * to the WP Toolbar.
     55 *
     56 * @since BuddyPress (1.6)
     57 */
     58function bp_admin_setting_callback_force_buddybar() {
     59?>
     60
     61        <input id="_bp_force_buddybar" name="_bp_force_buddybar" type="checkbox" value="1" <?php checked( ! bp_force_buddybar( false ) ); ?> />
     62        <label for="_bp_force_buddybar"><?php _e( 'Switch to WordPress Toolbar', 'buddypress' ); ?></label>
     63
     64<?php
     65}
     66
    5267/** Activity *******************************************************************/
    5368
    5469/**
  • bp-core/bp-core-admin.php

    class BP_Admin { 
    286286                add_settings_field( 'hide-loggedout-adminbar',        __( 'Toolbar',        'buddypress' ), 'bp_admin_setting_callback_admin_bar',        'buddypress', 'bp_main' );
    287287                register_setting  ( 'buddypress',           'hide-loggedout-adminbar',        'intval'                                                                              );
    288288
    289                 // Allow favorites setting
     289                // Allow account deletion
    290290                add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' );
    291291                register_setting  ( 'buddypress',           'bp-disable-account-deletion', 'intval'                                                                              );
    292292
     293                // Only show 'switch to Toolbar' option if the user chose to retain the BuddyBar during the 1.6 upgrade
     294                if ( (bool) bp_get_option( '_bp_force_buddybar', true ) ) {
     295                        add_settings_field( '_bp_force_buddybar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_force_buddybar', 'buddypress', 'bp_main' );
     296                        register_setting( 'buddypress', '_bp_force_buddybar', 'intval' );
     297                }
     298
    293299                /** XProfile Section **************************************************/
    294300
    295301                if ( bp_is_active( 'xprofile' ) ) {