nodebb-plugin-ns-custom-fields
nodebb-plugin-ns-custom-fields copied to clipboard
Question - Default key/type/name
What would be the best method to insert a set of default keys and values for them also push/store them to all users including new ones when they join too?
You could set custom fields to "default" values when a user is created - https://github.com/NodeBB/NodeBB/blob/b692dd87cd70b852ad619fd72358438d2805b2d8/src/user/create.js#L146 Action: action:user.create.
The overall idea with default values is a bit tricky. Custom Fields are considered as optional. The plugin is smart enough to skip custom fields which the user did not fill.