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.
Use this hook to filter the value converted from ACF to Formidable.
Formidable Forms is the best WordPress Form Builder plugin. Get it for free!
Usage
add_filter('frm_acf_acf_to_frm', 'frm_acf_acf_convert_to_integer', 10, 2);
Parameters
- $new_value (mixed): The converted value.
- $args (array): The args of FrmAcfAcfToFrmHelper::convert() method, with "old_value" added.
Examples
Convert number field value to integer
add_filter('frm_acf_acf_to_frm', 'frm_acf_acf_convert_to_integer', 10, 2);
function frm_acf_acf_convert_to_integer( $new_value, $args ) {
if ( 'number' === $args['acf_field']['type'] && 'number' === $args['frm_field']->type ) {
$new_value = intval( $new_value );
}
return $new_value;
}