Answer the question
In order to leave comments, you need to log in
Do you want to open links in a new window by default?
Hello.
I'm using Wordpress 4.7.4 It is
necessary that links open in a new window by default when inserting/editing. Those. to add 'target = _blank'.
How to add checkbox 'Open link in new tab'( https://i.stack.imgur.com/1b8TM.jpg) when you select 'Link options' ( https://i.stack.imgur.com/rpCiq.jpg) I figured it out.
function ahu_after_wp_tiny_mce() {
if (get_post_type() == 'post') { ?>
<script>
jQuery(document).on('wplink-open', function (wrap) {
if (jQuery('input#wp-link-url').val() <= 0)
jQuery('input#wp-link-target').prop('checked', true);
});
</script>
<?php
}
}
add_action( 'after_wp_tiny_mce', 'ahu_after_wp_tiny_mce' );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question