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)
- Not able to open category post [closed]
- Plugin upload to install
- How to make a customize role and view a specific plugins base on that role?
- Reusable functions and tools (Framework)
- How To Clean The Malware Infected & Hacked WordPress Websites? [duplicate]
- Do I still need a theme to use page builders?
- How to prevent users to download videos from lms website?
- Editing admin pages in WordPress [closed]
- How to get current post user id
- Only Homepage not loading properly
- WordPress takes too much time (100 seconds) to load – Front end and back end
- Hook to plugins admin settings
- Uncode theme content block header ignoring saved changes/not updating?
- Two (or more) looks, with one set of content
- Using custom JS plugins with WordPress?
- WordPress on AWS with ELB
- Different UI in WordPress
- Theme and plugin install or update display error in localhost
- Change the backend language of a single plugin
- Re-naming a theme/child theme whilst maintaining updates
- Can I make a super plugin that also has a theme?
- Reduce Drop down Menu Width in WordPress
- Layout Plugin Admin Pages: Use BootStrap? [closed]
- Remove Duplicator plugin from admin menu if not an administrator
- plugin style conflicts, how to override? [closed]
- Doubt using $wpbd->get_col for a single column
- Unable to upload wordpress plugins
- The problem with WordPress Importer
- How to disable CSS rule in Twentythirteen style.css?
- See which user installed a plugin?
- Prevent WordPress installing plugins and themes via Admin
- Add a custom form on the post-new.php admin page
- Plugin Handle URL With Custom Theme
- How to read individual user’s directory and display content to that specific user?
- Rotating background images with admin options
- Creating a nav menu
- Guidelines / restrictions about advertising /donate begging unside wordpress plugins or themes
- Admin Panel pagination link styles
- Is this the right way to execute some PHP in my plugin after a button click on an options page?
- Is there an easy way to flag posts in the admin area?
- How can I force users to a particular subdomain to log in for MU (Multisite)?
- Show an image in my header.php
- Admin Theme customization
- Hooking in to replace the Sidebar/Widget areas
- WSOD after upgrading to 3.1
- Display update notification messages like ‘What’s New’
- How to hide some section in WordPress under Post
- Default WordPress WP Editor removing style tags and html tag
- Add column to pages table
- Easiest way to add dropdown to a page
- How to get the element ID from new menu list that added with add_filter()?
- Check for security updates
- (FES EDD) New vendor submission page is blank
- There is any way to remove post-format filter? [closed]
- Plugin-generated pages use Not Found or Pages Archive templates?
- Is there any kind of theme on WordPress to sell my own movies?
- Create custom registration form for WordPress Multisite
- Child Pages Short Code plug-in and hover capabilities?
- Admin accounts unable to see plugins from external IP
- Merging Two menus in the backend into one menu
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- Classified ad website : which solutions to use? [closed]
- Linux Permissions and Ownership for WordPress
- posts comments goes to trash
- Facebook Messager Plugin
- WordPress site periodically goes down
- Masonry images not working
- Plugin dependencies: show notice like theme plugins dependencies
- Advanced Custom Field DatePicker [closed]
- Fatal error: Call to undefined function cmsms_theme_page_layout_scheme()
- Polylang : Interverting languages after development [closed]
- WordPress wp-admin/network/plugin-install