Remove the code that alters the wp_admin_bar_render
hooks.
#208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 toadmin_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 defaultin_admin_header
and once onadmin_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 );