I see from some digging that a custom_fields property exists on posts/topics and plugins make extensive use of it.
Is this field available through the API? Can it be set? Can it be queried against? Could a search be made for a topic with a certain value for a custom field?
@Falco thank you for the clarification. I will look to these plugins as examples.
I finally found what I was looking for… register_custom_field_type(). Prior to seeing this, I was rather confused on how the database handled the type information. Well, now I know
@Falco a belated thanks for the link to the Signatures plugin. Not only do I wholeheartedly approve of old-style forum signatures, but it’s a great example of putting user custom fields to work for this new Discourse developer.
Sorry for resurrecting an old thread, but I haven’t been able to answer this question by searching meta.
Are custom_fields available on post/topics via the API?
In the answer above, @Falco talks about how custom_fields are available to the plugin developer, but I see no definitive answer to the question in the topic title. My own experience suggests that they are NOT available via the API.
I’m developing in Ruby with the Ruby API gem but can’t seem to pass a custom_field value like others. My Ruby code is standalone so I can’t just use the Rails infrastructure to access custom_fields.
From memory, when I developed my migration script from MVCF, the custom_fields have to be added to an already existing parent. i.e. the parent is re-found, custom_fields added and the parent re-saved. I can see why that might not be straightforward with the API.
I need to pass custom_fields to categories and to topics (for the Events plugin) is it impossible or am I missing a trick?