Set the minimum date for second repeating date field

add_action(‘frm_date_field_js’, ‘start_and_end_dates_repeating’, 10, 2); function start_and_end_dates_repeating($field_id, $options){ $days_between = 0;// Change 0 to the number of days that should be between the start and end dates $field_one = ‘field_pickup‘;// Change pickup to the KEY of the first date field $field_two…Continue reading

Move description

add_filter(‘frm_custom_html’, ‘frm_move_field_description’, 20, 2); function frm_move_field_description( $default_html, $field_type ) { $start_description = ‘[if description]’; $end_description = ‘[/if description]’; $description_start_pos = strpos( $default_html, $start_description ); $description_end_pos = strpos( $default_html, $end_description ); if ( $description_start_pos === false || $description_end_pos === false )…Continue reading

Black out specific dates

add_filter(‘frm_selectable_dates’, ‘frm_black_out_specific_dates’, 10, 2); function frm_black_out_specific_dates( $selectable, $args ) { if ( $args[‘field’]->field_key == ‘pcm7rl3‘ ) { //replace pcm7rl3 with your field key $selectable = ‘( y+”-“+m+”-“+d != “2017-5-29” && y+”-“+m+”-“+d != “2017-7-4” )’; } return $selectable; }Continue reading

Disable datepicker on mobile

add_filter( ‘frm_field_classes’, ‘frm_remove_date_field_class’, 30, 2 ); function frm_remove_date_field_class( $class, $field ) { if ( $field[‘type’] == ‘date’ && wp_is_mobile() ) { $class = str_replace(‘ frm_date’, ”, $class ); } return $class; }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