Prepare data

add_filter( ‘frm_api_prepare_data’, ‘prepare_data’ ); function prepare_data( $data, $fields ) { foreach ( $fields as $k => $field ) { switch ( $field->type ) { case ‘checkbox’: case ‘select’: //do something break; case ‘file’: //do something break; case ‘date’: FrmAPIAppHelper::format_date( $field,…Continue reading

Change item name

add_filter( ‘rest_prepare_frm_entries’, ‘change_item_name’, 10, 3 ); function change_item_name( $response, $item, $request ) { if ( isset( $response->data[‘name’] ) ) { $response->data[‘name’] = ‘place here the new name of the item’; } return $response; }Continue reading

Change email field value

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’][…Continue reading

Change field label

add_filter( ‘frm_field’, ‘change_field_label’ ); function change_field_label( $field ) { if ( $field->id === ‘4089’ ) { $field->name = ‘place new label here’; } return $field; }Continue reading

Check for duplicates in repeating fields

add_filter( ‘frm_validate_field_entry’, ‘check_repeating_value_for_duplicates’, 10, 4 ); function check_repeating_value_for_duplicates( $errors, $posted_field, $posted_value, $args ){ if ( $posted_field->id == 12692 ) { //Replace 12692 with the ID of the repeater field. $field_to_check = 12694; //Replace 12694 with the ID of the field…Continue reading

Count number of edits

add_filter( ‘frm_setup_edit_fields_vars’, ‘frm_edit_counter’, 20, 4 ); function frm_edit_counter( $values, $field, $entry_id ) { if ( intval( $field->id ) === 12283 && ! FrmAppHelper::is_admin() ) { //Replace 12283 with your field ID $values[‘value’] = intval( $values[‘value’] ) + 1; } return…Continue reading

Set Style in form shortcode

add_filter( ‘frm_add_form_style_class’, ‘frm_add_style_attribute_to_form_shortcode’, 1 ); function frm_add_style_attribute_to_form_shortcode( $class ) { if ( ! isset( $_GET[‘use_style’] ) ) { return $class; } $new_style = $_GET[‘use_style’]; $new_style = utf8_decode( urldecode( $new_style ) ); $new_style = esc_html( $new_style ); remove_filter( ‘frm_add_form_style_class’, ‘FrmStylesController::get_form_style_class’, 10,…Continue reading

Exclude date field type

add_filter( ‘frm_quiz_score_field’, ‘exclude_date_field_type’, 10, 2 ); function exclude_date_field_type( $count_field, $args ) { if ( $args[‘field’]->type === ‘date’ ) { $count_field = false; } return $count_field; }Continue reading