Skip to:
Content

BuddyPress.org


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.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.