FrmField in php

By: Steven C | Asked: 03/23/2023
ForumsCategory: Code HelpFrmField in php
Steven C asked 2 years ago
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?
  1. I would like to know which action to use to fetch the value in a FrmField using php,
  2. ..and ideally also a complete list of the actions and what they all do.
Can anyone point me to the documentation page for these? Thanks!
Question Tags:
2 Answers
Best Answer
Rob LeVineRob LeVine answered 2 years ago
@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).
Steven C replied 2 years ago

@Rob LeVine - That is super helpful, appreciate it.

Victor Font answered 2 years ago

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/

Steven C replied 2 years ago

@Victor Font - Thank you for your help with the correct terminology. I will check out more at the Codex you referred, appreciate it.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right