Created
March 14, 2016 10:59
-
-
Save champsupertramp/191a95ae3212ceb8085d to your computer and use it in GitHub Desktop.
Ultimate Member - Follower Extensions - Auto-follow specific users on registration
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 | |
add_action('um_after_new_user_register','um_auto_follow_artists',10,2); | |
function um_auto_follow_artists( $user_id, $args ){ | |
global $ultimatemember, $um_followers; | |
$follow_users = array( | |
'rjtmusic', | |
'james-peacock', | |
'carl-thomson', | |
'jonathan-proud', | |
'stu-dawson', | |
'carly-mckee', | |
); | |
foreach( $follow_users as $username ){ | |
$follow_user = get_user_by( 'login', $username ); | |
$um_followers->api->add( $follow_user->ID, $user_id ); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello
Please explain this better please.. I don’t understand to use this