Hello,
I understand that in php I can for example use "FrmField::update" to update a field, and "FrmField::get_id_by_key" to get the id of a field for example.
Where can I find the full list of available FrmField actions? Are those actions like "update" and "get_id_by_key" unique to Formidable? Or are they general php actions?
Can anyone point me to the documentation page for these?
Thanks!
@Steven C - I will add that do get a value of a form field in PHP, you'll want to use FrmEntryMeta::get_entry_meta_by_field($entry_id, $field_id). The FrmField object is really only for the field itself, irrespective of its relation to the form. Other fields of use to you might be:
FrmEntryMeta::update_entry_meta
FrmEntryMeta::add_entry_meta
As for get_id_by_key that's a Formidable thing only and is available with most objects such as FrmField, FrmForm, etc. It's very useful for making your code transportable, by not using field ids (rather, using form keys).
@Rob LeVine - That is super helpful, appreciate it.
The example you are asking about is Object Oriented Programming syntax. FrmField is a class and get_id_by_key is a function within the class. A function is not an action. An action is a hook. WordPress has two types of hooks, actions and filters. The closest thing you’ll find to a list of everything in Formidable is our Codex. https://formidable-masterminds.com/codex/
@Victor Font - Thank you for your help with the correct terminology. I will check out more at the Codex you referred, appreciate it.
Please login or Register to submit your answer