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.
This hook can be used to filter the values of an entry in a csv import.
Usage
add_filter( 'frm_editing_entry_by_csv', 'change_email_field_value' );
Parameters
- $entry_id (int) The ID of the entry to edit. 0 means a new entry will be created.
- $values (array) The mapped values for this entry.
Examples
Change email field value
This example will change email field value of an entry in a csv import.
add_filter( 'frm_editing_entry_by_csv', 'change_email_field_value' );
function change_email_field_value( $entry_id, $values ) {
if ( $entry_id === 10 ) {
$email_field_id = '1234'; // Replace this value with the id of the field you need to change
$new_value = 'place value here';
$values['item_meta'][ $email_field_id ] = $new_value;
}
return $entry_id;
}