Created
          August 4, 2014 21:07 
        
      - 
      
- 
        Save gregrickaby/738cad75dfc4def693d1 to your computer and use it in GitHub Desktop. 
    Auto check the "Open link in a new window/tab" checkbox in WordPress
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| // DO NOT INCLUDE THE OPENING PHP TAG AND INSERT INTO FUNCTIONS.PHP | |
| add_action( 'admin_footer', 'custom_new_link_auto_check', 9999 ); | |
| /** | |
| * Auto check the "Open link in a new window/tab" modal | |
| */ | |
| function custom_new_link_auto_check() { ?> | |
| <script type="text/javascript"> | |
| jQuery ( function($) { | |
| $('input#link-target-checkbox').prop('checked', true); | |
| } ); | |
| </script> | |
| <?php } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment