Created
December 26, 2017 22:01
-
-
Save ideadude/acb33e74c931b8150de5e1d771b8adec to your computer and use it in GitHub Desktop.
Set a user's bbpress role when importing using the Import Users From CSV Plugin
This file contains hidden or 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
/* | |
Add this code to a custom plugin. | |
*/ | |
function bbpress_role_is_iu_post_user_import( $user_id ) { | |
//if you had a column in your import with the role in it, you can grab it from user meta instead of setting it here | |
$new_role_forum_role='bbp_participant'; | |
bbp_set_user_role( $user_id, $new_role_forum_role ); | |
} | |
add_action( 'is_iu_post_user_import', 'bbpress_role_is_iu_post_user_import'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment