Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Open External Links in New Tab
<?php
/**
* Open External Links in New Tab
*
* @author Edwin Velez (https://edwinvelez.net)
* @link https://edwinvelez.net/open-external-links-in-new-tab/
*/
function ev_load_my_scripts() {
wp_enqueue_script( 'external_links', get_stylesheet_directory_uri() . '/external_links.js', array( 'jquery' ), '1.0', true );
}
add_action( 'wp_enqueue_scripts', 'ev_load_my_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.