BuddyPress Toolbar
There’s actually an entire API for adding/removing items in the Toolbar. You’re specifically looking for the add_menu() method.
There’s actually an entire API for adding/removing items in the Toolbar. You’re specifically looking for the add_menu() method.
I believe you are talking about the admin_bar which has many hooks. You can read more about wp_before_admin_bar_render and wp_after_admin_bar_render in codex and actually wp source.
Undo your core-file change Replace query_posts() with a proper call to new WP_Query() for your secondary query loop. Your admin bar issues will auto-magically disappear.
You need to hook into ‘wp_before_admin_bar_render’, not ‘admin_bar_menu’. According to the documentation an action attached to this hook fires before the admin bar is rendered.
To answer your information from the comments (which actually should be edits to the question): So far, it has been very easy to use WP to replace my self-made code used to manage users’ login, write and output posts and static pages in 3 of my existing websites, without altering anything else the websites. You … Read more
There’s actually a show_admin_bar hook where you can always return true or false. I haven’t run across an issue where the admin bar is randomly disappearing though. Usually on my websites I like to turn it off for admins: /** * Remove Admin Bar For Administrators * Or anyone who can activate plugins */ function … Read more
It’s not possible without JavaScript. The HTML for it is output in the WP_Admin_Bar in a private and protected method with no filter. You can remove them after the page has loaded with JS like so: function wpse_287259_remove_skip_link() { echo “<script>jQuery( ‘.screen-reader-shortcut’ ).remove();</script>”; } add_action( ‘wp_after_admin_bar_render’, ‘wpse_287259_remove_skip_link’ ); I hope it goes without saying that … Read more
One solution to your problem is hiding admin bar from front-end. Maybe there is problem in your css too. To hide admin bar from front-end: To remove the toolbar from your site, go to Users > Your Profile. Scroll down to “Toolbar” and uncheck “Show Toolbar when viewing site.” Add add_filter(‘show_admin_bar’, ‘__return_false’); to functions.php of … Read more
This is my final working piece of code: function wpr_manager_filter($query) { global $pagenow; global $typenow; $current_page = isset( $_GET[‘post_type’] ) ? $_GET[‘post_type’] : ”; if ( is_admin() && ‘properties’ == $typenow && ‘edit.php’ == $pagenow ) { $queryParamsCounter = 0; if (isset( $_GET[‘city-filter’] ) && $_GET[‘city-filter’] != ‘-1’) { $cityId = (int)$_GET[‘city-filter’]; $queryParamsCounter++; } if … Read more
Yes it is possible, there is a code: // inside functions file add_filter(‘show_admin_bar’, ‘__return_false’);