Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/bc9a713c5c48bfee6ab3ebb6ff506b81 to your computer and use it in GitHub Desktop.
Save KaineLabs/bc9a713c5c48bfee6ab3ebb6ff506b81 to your computer and use it in GitHub Desktop.
Make New Accounts Follows Specific Users.
<?php
/**
* Make New Accounts Follows Specific Users.
*/
function yzc_make_new_accounts_follows_specific_users( $user_id ) {
// Get Leaders.
$leaders = array( 2, 4 );
foreach ( $leaders as $leader_id ) {
// Get Follow Args.
$args = array(
'leader_id' => $leader_id,
'follower_id' => $user_id,
);
// Follow .
bp_follow_start_following( $args );
}
}
add_action( 'bp_core_signup_user', 'yzc_make_new_accounts_follows_specific_users' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment