By default, myCRED will give users a badge automatically based on your setup. This snippet will allow you to create badges that will never be automatically awarded to users. These manual badges would need to be added manually by editing the user in the admin area.
Add to your child theme's functions.php file and create badges in the admin area using the reference "Badge is awarded manually".
Given a user id, is there a function to manually assign a badge to a user?
Sure, you can just use add_user_meta to add the badge to the user:
You will need to set the custom user meta’s value to the level you want to award. Use zero if you just have one level or if you want to award the first level.
One can now assign badge manually, without any code snippet.