Skip to:
Content

BuddyPress.org

Changeset 6159


Ignore:
Timestamp:
06/30/2012 02:26:50 PM (9 years ago)
Author:
djpaul
Message:

Reinstate the 'Switch to Toolbar' option when you chose to stick with the BuddyBar during a 1.6 upgrade. Fixes #3661.
Also fixes a problem with extra whitespace in wp-admin when using the BuddyBar.

Location:
trunk/bp-core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/admin/bp-core-settings.php

    r6157 r6159  
    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( true ) ); ?> />
     62    <label for="_bp_force_buddybar"><?php _e( 'Switch to WordPress Toolbar', 'buddypress' ); ?></label>
     63
     64<?php
     65}
     66
    5267/** Activity *******************************************************************/
    5368
     
    87102
    88103<?php
     104}
     105
     106/**
     107 * Sanitization for _bp_force_buddyvar
     108 *
     109 * If upgraded to 1.6 and you chose to keep the BuddyBar, a checkbox asks if you want to switch to
     110 * the WP Toolbar. The option we store is 1 if the BuddyBar is forced on, so we use this function
     111 * to flip the boolean before saving the intval.
     112 *
     113 * @since BuddyPress (1.6)
     114 * @access Private
     115 */
     116function bp_admin_sanitize_callback_force_buddybar( $value = false ) {
     117    return $value ? 0 : 1;
    89118}
    90119
  • trunk/bp-core/bp-core-admin.php

    r6156 r6159  
    287287        register_setting  ( 'buddypress',           'hide-loggedout-adminbar',        'intval'                                                                              );
    288288
    289         // Allow favorites setting
     289        // Only show 'switch to Toolbar' option if the user chose to retain the BuddyBar during the 1.6 upgrade
     290        if ( (bool) bp_get_option( '_bp_force_buddybar', false ) ) {
     291            add_settings_field( '_bp_force_buddybar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_force_buddybar', 'buddypress', 'bp_main' );
     292            register_setting( 'buddypress', '_bp_force_buddybar', 'bp_admin_sanitize_callback_force_buddybar' );
     293        }
     294
     295        // Allow account deletion
    290296        add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' );
    291297        register_setting  ( 'buddypress',           'bp-disable-account-deletion', 'intval'                                                                              );
  • trunk/bp-core/css/buddybar.dev.css

    r5865 r6159  
    1 body,
    2 body.wp-admin {
     1body:not(.wp-admin) {
    32    padding-top: 25px !important;
    43}
Note: See TracChangeset for help on using the changeset viewer.