This file contains 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 | |
if(is_plugin_active('memberpress/memberpress.php')) { | |
add_action( 'user_register', 'mp_auto_enroll' ); | |
//add_action( 'gform_user_registered', 'mp_auto_enroll', 10, 4 ); | |
function mp_auto_enroll($user_id, $user_config=array(), $entry='', $user_pass='') { | |
$txn = new MeprTransaction(); | |
$txn->user_id = $user_id; |
This file contains 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
function targetBlank() { | |
// remove subdomain of current site's url and setup regex | |
var internal = location.host.replace("www.", ""); | |
internal = new RegExp(internal, "i"); | |
var a = document.getElementsByTagName('a'); // then, grab every link on the page | |
for (var i = 0; i < a.length; i++) { | |
var href = a[i].host; // set the host of each link | |
if( !internal.test(href) ) { // make sure the href doesn't contain current site's host | |
a[i].setAttribute('target', '_blank'); // if it doesn't, set attributes |