You can do that with jQuery. We can open this link in new tab/window by adding target="_blank"
attribute dynamically on link which has URL https://www.example.com
. Here is the example function for that.
function wpse_my_custom_script() {
?>
<script type="text/javascript">
jQuery(document).ready( function($) {
$( "ul#adminmenu a[href$='https://www.example.com']" ).attr( 'target', '_blank' );
});
</script>
<?php
}
add_action( 'admin_head', 'wpse_my_custom_script' );
Don’t forget to change URL in above code or this will not work.
Tested & working!
Related Posts:
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- Is There a WordPress Hook to Filter the Edit Posts View?
- Add section (add_settings_section) to a custom page (add_submenu_page)
- Reordering themes in admin panel
- Include Max mega menu Plugin into theme
- Cannot access wp-admin after disabling all plugin
- Edit default comments page in WP Admin
- All Users > User List > Update User Meta Field Inline
- Globally register styles but enqueue them selectively
- Dynamic admin submenu
- Add sub menu page in your plugin
- How to get menu location in wp_update_nav_menu hook
- getting notifications about updates only in the “core” page
- Remove value from array within post meta ajax admin
- navigation among single posts
- I cannot include a file in my plugin settings page
- What is the most efficient way of adding additional functionaliy for admin only
- Elementor pro page editing gives error There has been a critical error on this website. Please check your site admin email inbox for instructions
- Mobile Menu and Mobile Sidebar missing
- WordPress Dashboard add user password not working, etc
- WordPress site hamburger menu toggle not working
- Add custom WordPress admin page with pretty url via code
- Admin page and admin menu. Permissions plugin
- Getting 404 page not found error while trying to access add new plugin / themes
- How to activate/deactivate menu tab and keep the same id?
- Why plugin’s icon for the menu not found?
- Allow direct access to files/folders within WordPress to replace wp-admin
- Prevent primary navigational menu from expanding during page load (WordPress / Astra Theme)
- I found this in a plugin. What does it do? is it dangerous?
- Check if add_menu_page exists or not
- Disable /wp-admin/plugin-install.php
- What are the best practices for updating?
- How to set back-end language per user?
- Shared functionality in plugins and themes
- How to add favicon to my site – in both front end and admin panel
- Create theme files for plugin
- Add custom menu item type
- Removing an admin page added by a 3rd party plugin. Gravity forms in this example
- WordPress admin notice in plugin function
- Using tabs for wordpress plugin
- How can I list only sites that use a particular theme or plugin?
- Themes VS Plugins [duplicate]
- How to make a WP admin button/menu similar to Jetpack Notifications?
- Trying to add admin file upload form plugin
- Can a WordPress plugin or theme contain a virus?
- How to add post_author column to custom post type
- WordPress site migration addvice
- How to Know if a Plugin can be used with my Theme [closed]
- Not able to open category post [closed]
- Reusable functions and tools (Framework)
- Using custom JS plugins with WordPress?
- WordPress on AWS with ELB
- See which user installed a plugin?
- Guidelines / restrictions about advertising /donate begging unside wordpress plugins or themes
- Admin Theme customization
- (FES EDD) New vendor submission page is blank
- Ad custom admin page like WordPress customizer [closed]
- Custom wordpress Theme and Plugin repository
- How to change the name of the “edit my profile” link in the WordPress admin backend
- How to make multiple admin pages for one plugin?
- Create custom pages with a plugin
- $wpdb update query in plugin only updating one column
- Does heavy theme and plugins affect server’s response time? [closed]
- Locked out of admin panel after installing HC Custom WP-Admin URL [closed]
- Proper way to use plugin functions in functions.php
- Use $variable from file1.php in file2.php (different file paths)
- How can I use my custom wordpress theme on two websites? [closed]
- Can I filter a function created by a theme or a plugin?
- Remove specific administrator’s capability
- plugin inside a wordpress theme
- How do i specify a url to which to redirect the user after he logs out from facebook?
- Share plugins, themes, and multi post in a multidomain network
- Removing the custom_image_header from wp_head
- Gantry Framework: new page loads homepage content instead of page content
- Upgrade not working & themes not supporting
- use EDD Content Restriction for restricting php in template
- force logged in user to stay in the dashboard
- What plugin would make this happen? If is the theme
- WordPress wp get_temp_dir return non exiting folder, thus failing plugin & themes update
- How to work with a custom theme that someone else created before me? (details below)
- when i activate my WordPress plugin cannot see customizer options or preview
- Writing SEO for Homepage when homepage is set to display latest posts
- Description: Too much time has passed without sending any data for document
- wordpress plugin translation not working
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- How can I share my wordpress site with a friend?
- WordPress menu and plugin installation problem
- The Commercial tab is missing from the Plugins page when trying to update Types 1.7
- Plugins not activated after update?
- Multiple Plugins Interacting with Menu
- Issues with Post 2 Post Plugin
- Custom Form only for admin
- Disqus plugin outputs script as literal text
- how to call jQuery in admin as well as in homepage
- How to get current template file used by WordPress?
- How do I add custom fields to the “Edit page” admin screen?
- How to make wordpress backend mobile optimized.?
- How to check if the Menubar contains no items?
- The Admin page isn’t showing in the sidebar of the dashboard
- Stop the user if login from the cookies