You ca use the conditional tag is_admin()
to check if you are on the front-end or back-end like this:
function bp_adminbar_currentsite_menu() {
global $bp;
if (!is_admin()){
?>
<li>
<!-- Insert your link url or relative url, and your link text below -->
<a href="http://EXAMPLE.COM">EXAMPLE LINK TEXT</a>
</li>
<?php
}
}
// Call The Function Above
add_action('bp_adminbar_menus', 'bp_adminbar_currentsite_menu', 999);
Related Posts:
- How to put placeholder text in the main post input area?
- maintaing consistent layout wordpress dashboard
- Admin – Handle data before creating or updating a post, page or custom post
- How can I replace content in the WP Admin area before an admin page is rendered?
- Disable Auto-Expanding Menu in WordPress Admin Menus
- Best practice for plugin: always detect admin-ajax call?
- Plugin Development – Get Admin Url (Including cases where wp-admin is not used)
- How can I add an image upload field directly to a custom write panel?
- Difference Between Filter and Action Hooks?
- Creating a table in the admin-style?
- How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?
- Is it possible to reuse wp.media.editor Modal for dialogs other than media
- How do i best handle custom plugin page actions?
- How to create an API for my plugin?
- How to store username and password to API in wordpress option DB?
- body_class hook for admin pages
- How do I improve this admin query snippet to avoid generating duplicate results on non-meta searches?
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- Plugin API for easy admin list table generation, handling & exporting of MySQL tables?
- Change admin language based on user (in single-site)
- Is there a limit on making calls to WordPress.org API’s?
- Export data as CSV in back end with proper HTTP headers
- What is the real intention for admin-post.php?
- Completely remove WP_Admin_Bar for specific user roles
- Is There a WordPress Hook to Filter the Edit Posts View?
- API to trigger prompt on leaving page
- Using filters and actions for plugin API?
- Admin config screen without menu
- Show message on wordpress admin dashboard
- Make Categories and Tags required in admin
- WordPress and multithreading
- Hook the Keydown Event in the TinyMCE Post Editor
- Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?
- how to use thickbox in admin?
- How do you create a custom edit.php / edit pages page
- Cancel post save
- permalinks with get variables
- Add a jQuery function to admin pages
- How to add HTML / Form to an Admin Bar Menu
- Is it save to require plugin.php early to be able to use get_plugin_data() earlier?
- WP Cron doesn’t save or in post body
- Create a clickable name in WP_List_Table for Plugin Admin
- Error with Custom Admin Screen in iframe Thickbox
- why don’t I get error messages in admin when developing?
- WP_Error handles errors, but how can I show success with a message?
- Filters ‘request’ and ‘parse_query’ not firing in sites.php nor link-manager.php
- URLs of plugin resources?
- Problems with removing admin bar
- Build dynamic page from cURL (HTML page) response with plugin
- Check if I am in the Admin Panel (wp-admin)?
- How to add custom content under plugin row in WordPress admin plugin list?
- How to override a function call in functions.php?
- wp_enqueue_style built in styles
- JS / JQuery form validation in backend admin menus
- Is it possible to modify the media library admin screen?
- How get Themes list via REST api?
- What does $_registered_pages do?
- How to load the plugin only when logged in?
- Should I ask my Twitter plugin users to create their own Twitter App and API Keys to use my plugin?
- How to redirect to action on custom page within admin section
- Get user id for delete and update selected user
- Add tab to profile.php wordpress plugin development
- WordPress Ajax callback function from plugin – OOP
- WP AJAX is not working, always returns 0
- Does WordPress’s HTTP API use any caching?
- How to get the ID of the currently logged in user?
- Add notification bubble notice in navigation using transients
- add_filter : Passing an array instead of the callback function?
- Can I individually style items in the backend widget list?
- Admin auto-refresh is interfering with Firebug — how to prevent it?
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- add a class when login
- Add a panel to edit post
- Where should I put “run once” plugin pages?
- Including a JS source with an admin page
- Using the default wordpress uploader inside plugin
- WordPress not working on localhost
- Modify users.php page to create page/post on button clicked
- Issue plugin commands in admin settings page
- Any problem in using native jquery ajax style instead of using admin-ajax.php?
- Replacing Scripts in Admin Load_Scripts
- Programmatically modify an admin page UI of a WordPress site from my WordPress plugin
- Buddypress function and global $bp question
- Add column and post filter for a custom post type field on the edit.php page
- Is there no admin ui guide for 4.x?
- Problems with: manage_${post_type}_posts_columns
- Global State During an Admin Post
- Example Dashboard Widget, Cancel not working
- Correct check for any admin page with editor
- All Users > User List > Update User Meta Field Inline
- Render content after post title in wp-admin
- Adding (blog-specific) links to “My Sites” admin page
- On cliking add new post redirect user to a custom page first
- Change the look and feel of admin pages
- Admin Plugin POST to another file within the plugin
- Amending REST API function without deactivate/activate plugin every time changes is made
- Why does wp_remote_post returns an empty body response on certain endpoints?
- What should happen when a WordPress Plugin is activated across the network (Network Wide Activation)
- Adding custom end points, No error line
- Prevent third party plugin’s admin page access based on user type