Round robin assignments

add_filter( ‘frm_validate_field_entry’, ‘frm_set_value_based_on_order’, 15, 3 ); function frm_set_value_based_on_order( $errors, $posted_field, $posted_value ) { if ( $posted_field->id == 175 ) { //change 175 to the ID of your group name field $group_id = $_POST[‘item_meta’][174] % 2;//change 174 to your auto_id field…Continue reading

Replace ampersand character reference

add_filter( ‘frm_email_value’, ‘frm_replace_ampersand’, 15, 3); function frm_replace_ampersand( $value, $meta, $entry ){ if ( $meta->field_id == 25 ) { //change 25 to the ID of your field $value = str_replace(“&”,”&”,$value); } return $value; }Continue reading

Store uploaded file URL in custom field

add_filter( ‘frm_new_post’, ‘create_a_custom_field’, 10, 2 ); function create_a_custom_field( $post, $args ) { $field_id = 25; // change 25 to the id of the file upload field if ( isset( $_POST[‘item_meta’][ $field_id ] ) ) { $field_value = sanitize_text_field( $_POST[‘item_meta’][ $field_id…Continue reading

Save entry ID in custom field

add_filter( ‘frm_new_post’, ‘frm_save_entry_id_to_custom_field’, 10, 2 ); function frm_save_entry_id_to_custom_field( $post, $args ) { if ( $args[‘form’]->id == 25 ) { //change 25 to the ID of your form $post[‘post_custom’][‘my_custom_field’] = $args[‘entry’]->id; } return $post; }Continue reading

Combine date and time

add_filter( ‘frm_validate_field_entry’, ‘frm_combine_date_time’, 8, 2 ); function frm_combine_date_time( $errors, $posted_field ) { $date_field = 25; // change 25 to the id of your date field $time_field = 26; // change 26 to the id of your time field $combo_field =…Continue reading

Keep the default value

add_filter( ‘frm_validate_field_entry’, ‘ff_keep_default_value’, 10, 3 ); function ff_keep_default_value( $errors, $posted_field, $posted_value ) { $fields = array( 166, 168, 169 ); //change 166, 168, 169 to the IDs of the fields whose defaults you want to keep. Include as many fields…Continue reading

Auto-populate address field for current user

add_filter(‘frm_get_default_value’, ‘auto_populate_address_field’, 10, 2); function auto_populate_address_field( $new_value, $field ) { if ( $field->id == 250 ) { //change 250 to the ID of the field you want to autopopulate global $wpdb; $user = wp_get_current_user(); $get_field_id = ‘256’; $get_field = FrmField::getOne(…Continue reading

Auto-populate address field by passed entry ID

add_filter( ‘frm_get_default_value’, ‘auto_populate_address_field’, 10, 2 ); function auto_populate_address_field( $new_value, $field ) { if ( $field->id == 135 ) { //change 135 to the ID of the field you want to autopopulate if ( isset( $_GET[‘pass_entry’] ) && $_GET[‘pass_entry’] !== ”…Continue reading

Show Removed Option

add_filter(‘frm_setup_edit_fields_vars’, ‘show_removed_options’, 25, 2); function show_removed_options( $values, $field ) { if ( FrmAppHelper::is_admin_page(‘formidable’) || empty( $values[‘value’] ) ) { return $values; } if ( in_array( $field->type, array( ‘select’, ‘radio’, ‘checkbox’ ) ) ) { if ( ! in_array( $values[‘value’], $values[‘options’]…Continue reading

Copy field value

add_filter(‘frm_setup_edit_fields_vars’, ‘frm_copy_field_value_before_edit’, 20, 3); function frm_copy_field_value_before_edit( $values, $field, $entry_id ) { if ( $field->id == 171 ) { //Replace 171 with the field ID of the field that you want to store the original entry in // If on the…Continue reading