hi to all, on this on this hook,is possible copy and truncate text on new field?
Use the code below to save the original values of multiple fields in Hidden (or other types of) fields. This is helpful if you want to see if there have been changes to multiple fields when the entry is edited. For the field pairs, put the id of the Hidden field to the left of the arrow and the id of the original field (the one you want to copy) on the right. You can add as many additional pairs as you'd like or remove pairs, if you have fewer than three.
-
add_filter('frm_setup_edit_fields_vars', 'frm_copy_multiple_field_values_before_edit', 20, 3);
function frm_copy_multiple_field_values_before_edit( $values, $field, $entry_id ) { $field_pairs = array( //for each pair of fields, put the id of the copy on the left and the original field on the right
979 => 336,
); if ( ! empty( $field_pairs[$field->id])){
$args = array(
'field_id' => $field_pairs[$field->id],
'entry' => $entry_id,
); $values['value'] = FrmProEntriesController::get_field_value_shortcode( $args );
} return $values;
}