The Formidable Forms Codex is a labor of love contributed to and used by Masterminds the world over. It is a living database of Classes, Functions, Actions, and Filters built into Formidable Forms. It is the most complete Formidable Forms developer documentation available anywhere. Wherever possible, it includes real-life examples, contributed by Masterminds, on how to use these features.
For the record, Masterminds are Formidable Forms developers just like you and me. We stake our incomes on providing world-class development skills and Information Technology services in support of the online business community. This Codex is just one example, and a rather simple one, of an application that can be built using Formidable Forms.
The Codex currently consists of the following record counts for:
- Classes: 195
- Functions: 1771
- Actions: 133
- Filters: 380
The record counts shown above are extracted in real-time from the Formidable wp_frm_item_metas table via a custom shortcode.
Compiling this information is no easy task. Each time the Strategy 11 team releases a new Formidable update, it may include new functions or hooks. The multi-step process we use for updating the Codex includes the following steps:
- Using the Ultra Edit editor for Mac we search every PHP file in the Formidable and Formidable Pro directories for specific keywords such as class, function, do_action, apply_filters, etc. Within seconds Ultra Edit returns a list of the location of every file and the line number containing the search string.
- The search results are saved in a text file that is parsed for the line containing each component's declaration, with all extraneous information getting deleted.
- If we're updating functions, we only consider public or public static functions. Private and protected functions are not added to the codex. We also ignore double underscore ("__") function names.
- Once the search results are sanitized, we extract a file of the component names only. This list is compared against the list of previous added records. If the lists match, there's nothing else to do.
- If the list of component names do not match, we extract the new items and run them through another custom tool we've built that converts the search result records into a properly formatted csv that can then be uploaded into our Codex Formidable form.
Using our custom tools allow us to process Codex details in minutes, rather that updating thousands of records manually, a process that can require days, weeks, or months to complete.
Our tools are designed tailored to our requirements for building the Codex. They are roughly built and not intended for public consumption. However, if you want to examine a working example of code used to process a text file and format it as an uploadable CSV, you can view the Gist. If you decide to download the example code and modify it for your own use, we are not supporting it. You are on your own.
The file locations for all classes are listed so you can review the source code for functions and hooks should you have a need to see how the Formidable developers intended them to be used.
Functions, actions, and filters are cross referenced to the classes to which they belong. These class references are linked to the Class entry. Hyperlinks in any entries are generated on-the-fly through custom code executed in the frm_display_entry_content filter.
We only include public functions in the Codex. Public static and public functions are executed differently. The syntax for public static functions is Class::function_name(), where public functions require you to instantiate a new instance of its parent class object.
Example: $myclass = new class(); Function: $myclass->function_name();
Actions and filters are types of WordPress hooks. Formidable uses both dynamic and static actions and filters.
Dynamic hooks are defined at runtime. The dynamic portion of the hook name is built using variables. Formidable has many dynamic hooks. Example of this include 'frm_after_update_entry_' . $new_values['form_id'] (Action) and 'frm_entries_' . $col_name . '_column' (Filter).
In most cases, it's nearly impossible to know the actual name of a dynamic hook just by reading the source code. It takes some advanced debugging skills or a deep knowledge of WordPress to determine the actual hook name. Teaching that level of developer skill is beyond the scope of this site.
Static hooks are the ones you are most doubt most familiar. Their names are spelled out in readable text. Examples of static hooks include frm_after_field_created (Action) and frm_field_html_id (Filter).
How You Can Help
It's our hope that Formidable Masterminds everywhere will help contribute to this Codex. Every detail page has a Mastermind Contribution form on it, as well as a Formidable view to display approved contributions.
If you write code and found ways to use classes, functions, actions, or filters, would you consider posting your contribution? Chances are that if you have a requirement that hasn't been documented before, somebody else may also be looking for a solution to the same problem.
We also welcome guest tutorials, tips & tricks, and code snippets. If you write posts like this for your own site and want to share your content here, we'll be sure to set the canonical URL to reference the content on your site. Please contact us at firstname.lastname@example.org to share your interests.