Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
By default, FrmEntryFormatter class supports some format values (array, json, plain_text_block, and table). This filter helps you add a new format value based on the format passed to FrmEntryFormatter class.
Usage
add_filter( 'frm_entry_formatter_format', 'add_entry_formatter_format', 10, 2);
Parameters
- $format (string): Format property.
- $args (array): Includes `atts` and `entry`.
Examples
Add new format value
add_filter( 'frm_entry_formatter_format', 'add_entry_formatter_format', 10, 2);
function add_entry_formatter_format( $format, $args ) {
if ( isset( $args['atts']['format'] ) && 'new_format' === $args['atts']['format'] ) {
$format = 'new_format';
}
return $format;
}