“Open link in a new window/tab” Checked by default in WordPress
Here is a simple script I created to set the “Open link in a new window/tab” checkbox to checked by default in WordPress.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
/* * Sets "Open link in a new window/tab" to checked by default */ function ahu_after_wp_tiny_mce() { ?> <script type="text/javascript"> jQuery( function() { jQuery( 'input#link-target-checkbox' ).prop( 'checked', true ); } ); </script> <?php } add_action( 'after_wp_tiny_mce', 'ahu_after_wp_tiny_mce' ); |
There might be a better way…