php - Load admin bar without wp_head or wp_footer

This question already has answers here:Manually add admin bar(2 answers)Closed 5 years ago.Is there any possible way to

This question already has answers here: Manually add admin bar (2 answers) Closed 5 years ago.

Is there any possible way to load admin bar without wp_head or wp_footer? If no, so maybe there is a way to load wp_head() or wp_footer() to catch only admin bar functions, styles and scripts? Is this even possible in worpdress?

For example: wp_head(load_admin_bar()); or something like that.

Thanks for any answers.

This question already has answers here: Manually add admin bar (2 answers) Closed 5 years ago.

Is there any possible way to load admin bar without wp_head or wp_footer? If no, so maybe there is a way to load wp_head() or wp_footer() to catch only admin bar functions, styles and scripts? Is this even possible in worpdress?

For example: wp_head(load_admin_bar()); or something like that.

Thanks for any answers.

Share Improve this question edited Jun 21, 2017 at 11:30 Tauras asked Jun 21, 2017 at 11:19 TaurasTauras 1235 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 1

Looks like, the only solutions which worked was to call admin bar directly.

if (current_user_can('administrator') || current_user_can('editor')) {
 wp_admin_bar_render();
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745438279a4627710.html

相关推荐

  • php - Load admin bar without wp_head or wp_footer

    This question already has answers here:Manually add admin bar(2 answers)Closed 5 years ago.Is there any possible way to

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信