You might want to use WP_User::set_role( 'contributor' )
instead. It unsets all current roles and sets the new one (the argument) too.
So the above would be
if ($count_posts >= $postlimit) {
$current_user->set_role( 'contributor' );
}
You might want to use WP_User::set_role( 'contributor' )
instead. It unsets all current roles and sets the new one (the argument) too.
So the above would be
if ($count_posts >= $postlimit) {
$current_user->set_role( 'contributor' );
}