Add this function in your theme’s functions.php
function my_enqueue($hook) {
if ('post.php' != $hook ) {
return;
}
wp_enqueue_script('my_custom_script', get_template_directory_uri() . '/js/myscript.js');
}
add_action('admin_enqueue_scripts', 'my_enqueue');`
In myscript.js place this code
jQuery(document).ready(function(){
jQuery('#wp-link-target').prop("checked", true);
})
It worked for me.
Related Posts:
- How to use wpLink without editor?
- Add CSS Class to Link in TinyMCE editor
- Can’t add a class to links in the visual editor since WP 3.1?
- How do I remove or disable “Or link to existing content” in “insert link” dialogue?
- Custom Post Type archive link in WYSIWYG editor
- Default Link for TinyMCE “Add Link”
- How to customize the “Insert/edit link” popup box?
- Add class to all links created by tinyMCE
- Remove the preview link box since 6.0 update
- Displaying Most Recently Edited Post
- WordPress 4.5 Inline Link Toolbar not working on custom wp_editor instance
- tinymce “Link” popup throwing error, not working
- Allow Linking to draft posts from classic editor
- Extra TinyMCE editor strips and tags?
- Get parent page url to show up when it is in child pages
- Why is there a link tag with rel “profile” pointing to gmpg.org?
- Forcing reload of editor-style.css
- Initialize TinyMCE editor / visual editor after AJAX insert
- No filter of code on switch from html to visual editor, how?
- WordPress 3.9 – Trouble Editing TinyMCE 4.0
- How to print translation supported text with HTML URL
- How set defaults on wpLink()
- Get the prev / next page links only (not title, etc)
- How to modify image editor dialog options on WordPress?
- How to include own css on wordpress tinymce editor?
- How to force TinyMCE in WordPress to replace newlines with tags and not with
- How to add multiple buttons to TinyMCE?
- Why did multiple line breaks stop working in text editor?
- Modify links when inserted by WYSIWYG editor
- Add a class to links in the visual editor (how to get old dialog back)
- How to re-enable the links manager?
- Stop certain classes showing up in TinyMCE Advanced Style dropdown
- Wondering how to turn your firefox bookmarks into a WordPress blog?
- When switching from html to visual editor the tag gets corrupted
- Markup of oEmbed codes in the editor?
- How to add a class to ul tags created by the WordPress editor Tinymce?
- How can I link to the most recent post in a category?
- How can I stop TinyMCE from converting my HTML entities to characters?
- Links redirecting to localhost after migration to server
- Is it possible to link to draft pages?
- How can I find all internal links that are pointing to post/page?
- Disable text tab on WordPress text-editor
- Creating a Link Directory using WordPress?
- Count and show Clicks on external links in a single page/post
- How to use wp_rel_nofollow to add nofollow to external links only?
- get_category_link() is returning nothing
- How can I insert HTML attributes with an existing TinyMCE button?
- Add Shortcode inline inside Gutenberg block
- Change padding to text indent in “Increase indent” TinyMCE
- Issues creating a tinyMCE plugin that creates a custom link
- Getting archive pages in WP’s AJAX internal link finder?
- Is there any way to set default for “Insert/Edit Link” to “Open link in new window”?
- Want to have the Post editor remembering the last editing position
- root-relative links for multiple parked domains
- Get link value only from the_content()?
- How to splice in wp_links links into the loop?
- TinyMCE Autoresize
- TinyMCE editor – new lines not rendered on front end
- two tinyMCE editors in the same page
- widget to output a link to archive view
- WordPress tinymce prints empty P tag and break html format
- Is there an easy way to create a links index page?
- What is the canonical way to link to pages?
- how can i add a menu link that goes to an external page
- Remove all links to a specific website
- HTTPS page link in menu
- Retrieving all Links from a Post?
- Link Category Description
- WP 3.3 my rich text category editor toolbar is gone!
- Auto-embed link info from URLs in link post format?
- programatically change href to onclick=window.open
- What is this: data-wplink-url-error=”true” and why is it added to my links?
- Get Stylesheet To Showup in WP Admin Panel Editor
- Disable automatic content hyperlinking
- Add table controls with wp_editor minimal editor configuration (‘teeny’)
- Deep linking to an accordion tab with Visual Composer
- Setting a page link in the footer?
- Insert shortcode in post editor from javascript (Visual / HTML)
- 2nd button row from WP Super Edit or TinyMCE Advanced doesn’t show to 2nd admin
- How to add/change a value of $wpdb property/var?
- Need advice on how to add links in users profile page?
- Generate Random Post Links Somewhere in the post
- TinyMCE Plugin Parameter
- How to hide a customization link themes menu in wordpress?
- WYSIWYG editor in WP 3.2 plugin
- Getting only the most recent bookmark?
- WordPress links/bookmarks – need to urlencode because spaces are getting stripped
- WYSIWYG – Getting the “link” button from HTML mode in Visual mode
- How can I get the post content displayed in a text field that allows to edit posts?
- Add WYSIWYG to Image Description field
- Add Link Text Back to Insert/edit link Box
- Link button is not working while editing a post in Firefox [closed]
- in network setup super admin has the tinyMCE buttons and the regular admin has not
- Disable HTML (Text) Tab in Post Editor
- How to list all external URLs that I have posted on my WordPress blog?
- How do I make my navigation bar link to an external page?
- Plugin that inserts favicon next to links
- Create anchor from Wysiwyg editor
- Is there any way of changing the post order via user click?
- Get post / page ID from ACF Link field