Skip to content

Remove the code that alters the wp_admin_bar_render hooks.#208

Merged
thomasgriffin merged 1 commit intoTGMPA:masterfrom
johnbillion:admin-bar
Aug 7, 2014
Merged

Remove the code that alters the wp_admin_bar_render hooks.#208
thomasgriffin merged 1 commit intoTGMPA:masterfrom
johnbillion:admin-bar

Conversation

@johnbillion
Copy link
Copy Markdown
Contributor

The code that alters the hooks for the admin bar is redundant and causes the admin bar to be processed twice on the "Install Required Plugins" screen.

The following two lines are erroneous because wp_admin_bar_render hasn't been hooked to admin_footer since WordPress 3.4 (Trac ticket #20161).

remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
add_action( 'admin_head', 'wp_admin_bar_render', 1000 );

This causes wp_admin_bar_render to be hooked twice, once on the default in_admin_header and once on admin_head. The net effect is that the admin bar is processed twice, which causes breakage. An example of this in the wild is my User Switching plugin which throws a notice on this screen due to the node it hooks onto not being available.

Additionally, the following two lines achieve nothing because we're in the admin area so they can be removed too:

remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
add_action( 'wp_head', 'wp_admin_bar_render', 1000 );

justinticktock pushed a commit to justinticktock/role-based-help-notes that referenced this pull request Jul 3, 2014
OK this is a bug in that plugin activation class. I opened a pull request here: TGMPA/TGM-Plugin-Activation#208

Marking this thread as resolved as it's not a User Switching issue.
thomasgriffin added a commit that referenced this pull request Aug 7, 2014
Remove the code that alters the `wp_admin_bar_render` hooks.
@thomasgriffin thomasgriffin merged commit fc337d8 into TGMPA:master Aug 7, 2014
@thomasgriffin
Copy link
Copy Markdown
Contributor

Thanks for the PR. Merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants