Skip to:

Opened 3 years ago

Closed 2 years ago

Last modified 17 months ago

#3661 closed task (fixed)

Switch to WP admin bar

Reported by: DJPaul Owned by: DJPaul
Milestone: 1.6 Priority: normal
Severity: blocker Version:
Component: Toolbar/BuddyBar Keywords: has-patch


New installs will get WP's admin bar. A new screen in the Upgrader will prompt users to choose to keep using the buddybar, or switch to the WP admin bar.

Attachments (2)

3661.01.patch (3.3 KB) - added by DJPaul 2 years ago.
3661.02.patch (2.3 KB) - added by DJPaul 2 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 DJPaul3 years ago

  • Owner set to DJPaul
  • Status changed from new to assigned

This one's mine, per the dev chat.

comment:2 DJPaul3 years ago

  • Type changed from enhancement to task

comment:3 DJPaul3 years ago

The goal is to migrate people to the Admin Bar. I'm about to put this in. Some notes:

Old behaviour:

  • BP_USE_WP_ADMIN_BAR, set to True, is currently used to switch to the WP Admin Bar.

New behaviour:

  • If BP_USE_WP_ADMIN_BAR set to True, it will always use the WP Admin Bar. If it's set to False, it will always use the BuddyBar.
  • New installs will default to the WP Admin Bar. The person installing BP sees no option to switch to the BuddyBar.
  • During upgrades, if BP_USE_WP_ADMIN_BAR is *not* set, the site is switched to the WP Admin Bar unless the admin ticks a box on a new screen which I've added to the upgrader.
  • After upgrades where the admin chooses to continue using BuddyPress, I've added a checkbox to the BuddyPress > Settings screen. If this is ticked and the form submitted, it will switch them to the WP Admin Bar.
  • There is no way to switch back to the BuddyBar once you are on the WP Admin Bar, but BP_USE_WP_ADMIN_BAR is still king, allowing customisations via wp-config.php, or perhaps someone creating a plugin to force back the BuddyBar.

I've tested the patch thoroughly but am leaving the ticket open for any comments or changes to the implementation.

comment:4 djpaul3 years ago

(In [5223]) Switch to use the WP Admin Bar by default. See #3661

comment:5 DJPaul3 years ago

  • Keywords dev-feedback added

comment:6 djpaul3 years ago

(In [5295]) Fix admin bar not showing for logged-out users. See #3661

comment:7 r-a-y3 years ago

Re: admin bar not showing - also see #3645.

comment:8 DJPaul3 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

Closing this ticket as the work's complete and no feedback has been received in two months. The ticket r-a-y refers to is open and in the 1.5.2 milestone, so it will get looked at soon. If anyone finds any bugs with the changes in this ticket, please create new tickets.

comment:9 tungdo2 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I'm testing 1.6 beta on an existing local install.


  • WordPress 3.4.1 Multisite
  • BuddyPress 1.6 beta
  • Buddybar option is ticked during upgrade to continue using the buddybar, not the WP Admin Bar.


  • Buddybar HTML is not loaded/shown for logged in and non-logged in accounts. Although, CSS is loaded.
  • At BuddyPress > Settings > Toolbar. If you "Show the admin bar for logged out users" then the BuddyBar will display.

Also, there is no setting to switch to the WP Admin Bar like the upgrade note mentioned.

comment:10 DJPaul2 years ago

  • Severity changed from normal to blocker

Thanks for the report. On non-ms, logged in, I see the buddybar on the front of the site. It works. I don't see the 'switch to wp toolbar' option in the backend, that has gone missing.

comment:11 DJPaul2 years ago

I have attached a patch which restores the menu option. I have not updated the save logic because the patch on #4301 changes the same area of code. Once #4301 is in, we can continue work on this ticket.

We also need someone else to confirm the behaviour on multisite. On non-ms the setting seems to be working as intended (apart from the missing option). I cannot see any broken CSS, nor the BuddyBar not loading after the 1.6 upgrade.

DJPaul2 years ago

DJPaul2 years ago

comment:12 DJPaul2 years ago

  • Keywords has-patch added; dev-feedback removed

Sorry, kept messing up the patch attachment. Use 3661.02.patch.

comment:13 tungdo2 years ago

Without the patch, I've tested 1.6 with two different multi-site installs with the same problem/result. Can anyone else duplicate this problem?

comment:14 boonebgorges2 years ago

I can't reproduce the problem as reported, but something is still not right.

  1. Installed BP 1.5.6, using BuddyBar, on WP r21198
  2. Upgraded to BP r6156, selecting the option to continue using the BuddyBar during installation
  3. As per default settings, "Show the admin bar for logged out users" is checked
  4. Visit site as non-logged-in user. BuddyBar shows as expected on root and non-root blogs
  5. Visit site as logged-in user. BuddyBar shows as expected on root and non-root blogs

So far, this all seems like it's working the way it should. However:

  1. Uncheck "Show the admin bar for logged out users" and save settings
  2. Visit site as non-logged-in user. BuddyBar does not show (as expected)
  3. Visit site as logged-in user. BuddyBar does *not* show. WP toolbar shows. BuddyBar CSS is loaded, pushing the page content down a number of pixels.

So, 8 seems like the real problem, as far as I can see. tungdo - This does not match what you've described. Are you running additional plugins, or a custom theme that may be modifying the way the bar appears? What BP-specific constants have you defined in bp-custom.php or wp-config.php?

comment:15 djpaul2 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [6159]) 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.

comment:16 DJPaul2 years ago

@Boone, sorry, I didn't see your last update before I pushed the commit. I spotted a bug where the BuddyBar stylesheet was loading extra top margin, only in wp-admin. I assume WP core changed how they set the position of the toolbar at the top of the page.

comment:17 boonebgorges2 years ago

No problem.

The problem I describe above (number 8) is still happening, and appears to be caused by r5295. DJPaul, can you have a look, and maybe reassemble the logic there?

comment:18 boonebgorges2 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:19 djpaul2 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [6161]) Stop the Toolbar showing when the user is logged in and the BuddyBar is enabled. Fixes #3661 again.

comment:20 johnjamesjacoby17 months ago

(In [6762]) Move bp_core_load_admin_bar() to bp_init, and also move the function itself into bp-core-adminbar.php next to bp_core_load_admin_bar_css(). Fixes bug causing current user to be loaded out of order. Fixes #4803. See #3661.

Note: See TracTickets for help on using tickets.