What code removes the admin bar for all users in WordPress 3.3?

/* Front end */ show_admin_bar( false ); /* back end */ function disableAdminBar(){ remove_action( ‘admin_footer’, ‘wp_admin_bar_render’, 1000 ); function remove_admin_bar_style_backend() { echo ‘<style>body.admin-bar #wpcontent, body.admin-bar #adminmenu { padding-top: 0px !important; }</style>’; } add_filter(‘admin_head’,’remove_admin_bar_style_backend’); } add_action(‘init’, ‘disableAdminBar’); Modified version of http://wp.tutsplus.com/tutorials/how-to-disable-the-admin-bar-in-wordpress-3-3/

How to Move the Comments Bubble to the Right Side of the Toolbar

After you have removed the comments bubble, you add it again. The trick is that in the $args of add_node you have to set parent to top-secondary. So it will look like this: add_action( ‘admin_bar_menu’, ‘wpse227079_toolbar_link_to_bubble’, 999 ); function wpse227079_toolbar_link_to_bubble ( $wp_admin_bar ) { $args = array( ‘id’ => ‘wp-admin-bar-comments’, ‘parent’=> ‘top-secondary’, ‘title’ => ‘QQ’, … Read more

How to make custom button link on the WordPress Admin Bar run by AJAX

Below is the complete code on how to do it. For more details you may like to see how admin ajax work on codex. <?php /* Your code to add menu on admin bar */ add_action(‘admin_bar_menu’, ‘add_item’, 100); function add_item( $admin_bar ){ global $pagenow; $admin_bar->add_menu( array( ‘id’=>’cache-purge’,’title’=>’Cache Purge’,’href’=>’#’ ) ); } /* Here you trigger … Read more

Admin Top Bar Not Showing On Front End

It certainly can be a theme related ‘problem’. To prevent unexpected problems in a theme, I frequently disable the admin bar while working on it. Look in functions.php (or similar) for code that looks like this and remove it: function my_function_admin_bar() { return false; } add_filter(‘show_admin_bar’, ‘my_function_admin_bar’);

Hide admin toolbar based on a query string

You should be able to just add the filter inside of a conditional: <?php if ($_GET[‘hidetoolbar’]) { add_filter(‘show_admin_bar’, ‘__return_false’); } ?> or, since conditionally adding action handlers and filters is sometimes frowned upon, you could add your own function as a filter and then put your conditional inside that: <?php function my_manage_toolbar() { if ($_GET[‘hidetoolbar’]) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)