This is actually related to a previous question ( Appending markup to privatemsg message body ) but as it's a slightly different issue I figured I'd start a new question.
In my original question, tenken's suggestion is to create a new module implementing
hook_field_info(), then use
hook_enable() to attach the custom field to the privatemsg bundle.
I have sort of figured out the gist of defining a custom field and attaching it to a bundle, but I'm stuck with a few things despite extensive googling, searching drupal.org and documentation as well as searching for video tutorials on YouTube. Specifically:
- when populating arrays to use with
field_create_instance(), I'm not sure what I should specify for the
entity_typevalue. I know typical examples for these functions usually refer to 'user' and 'node', but what should it be for privatemsg?
- I don't want the field to be visible on any forms as it's only intended to be populated "behind the scenes". I understand that I need to define a custom field formatter for that. How do I do that?
I think those are my only obstacles at the moment. Sorry if I appear lazy at all, but I only have very limited experience with Drupal module development, much less the field API, and this is my first D7 module. Needless to say I have searched for specific answers to the above but they continue to elude me!