I’ve added a custom user field using a plugin, following the example at:
This works great and the custom field appears on the user’s profile edit page, and the value can be edited and saved.
Note: I’m aware that
/admin/customize/user_fields allows the creation of custom user fields through the UI, however I discovered that the fields created in this way are internally given a generic name like
user_field_2 (for example) and for my use case I need the field to have a predetermined permanent name that my plugin code can reliably refer to.