Skip to content

Instantly share code, notes, and snippets.

@BoweFrankema
Created March 31, 2017 22:27
Show Gist options
  • Save BoweFrankema/acbe0a36a56fba9b160da520b9a3acab to your computer and use it in GitHub Desktop.
Save BoweFrankema/acbe0a36a56fba9b160da520b9a3acab to your computer and use it in GitHub Desktop.
Make user author
add_action('bp_core_activated_user', 'bp_custom_registration_role',10 , 3);
function bp_custom_registration_role($user_id, $key, $user) {
$userdata = array();
$userdata['ID'] = $user_id;
$userdata['role'] = 'author';
//only allow if user role is my_role
if (($userdata['role'] == "subscriber") or ($userdata['role'] == "contributor"))
wp_update_user($userdata);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment