@spiritix
Active 9 years, 11 months ago
-
Henry Wright replied to the topic How to assign a WP user role based on a registration in the forum How-to & Troubleshooting 9 years, 11 months ago
Hi @spiritix
Just to point out, you can’t use
or
in PHP. Instead you should use a double pipe like this||
. So your code becomes:if ( ( $userdata['role'] == "subscriber" ) || ( $userdata['role'] == "contributor" ) )
wp_update_user( $userdata );