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