‘adminbar’ in widget
-
hey guys,
i am trying to create a second adminbar which i can display in a nice sidebarwidget (of course not longer as a ‘bar’ but more a square but that should be some quick css styling).
So after digging through the admin-bar, class-admin-bar php files and many others i thought i finally understood what is going on and how to create a clone of the adminbar which i can put where i want and style how i want. Guess i was wrong.
This is the function i come up with:
function admin_menu_test() { require_once( ABSPATH . WPINC . '/class-wp-admin-bar.php' ); $admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' ); $wp_admin_bar = new $admin_bar_class; wp_admin_bar_my_account_menu($wp_admin_bar); $wp_admin_bar->add_menus(); $wp_admin_bar->initialize(); $wp_admin_bar->render(); }
Using the function i get a second adminbar, however it is empty. It would be much appreciated if someone could give me a hint how to do it correctly!
Thanks a lot in advance!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘‘adminbar’ in widget’ is closed to new replies.