Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the code that alters the wp_admin_bar_render hooks. #208

Merged
merged 1 commit into from
Aug 7, 2014
Merged

Remove the code that alters the wp_admin_bar_render hooks. #208

merged 1 commit into from
Aug 7, 2014

Conversation

johnbillion
Copy link
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
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.

None yet

2 participants