Show ten rows

add_filter( ‘frm_repeat_start_rows’, ‘frm_set_ten_rows’, 10, 2); function frm_set_ten_rows( $row_num, $field ){ if ( $field[‘id’] == 508 ) { $row_num = 10; } return $row_num; }Continue reading

Basic Usage

add_filter(‘frm_custom_html’, ‘frm_customize_html’, 20, 2); function frm_customize_html($default_html, $field_type){ //$default_html = ‘change HTML here’; return $default_html; }Continue reading

Set the minimum date for the second date field

add_action(‘frm_date_field_js’, ‘start_and_end_dates’, 10, 2); function start_and_end_dates($field_id, $options){ $key_one = ‘pickup‘;// Change pickup to the KEY of the first date field $key_two = ‘dropoff‘;// Change dropoff to the KEY of the second date field $days_between = 0;// Change 0 to the…Continue reading

Checkbox and Radio Button HTML

add_filter(‘frm_replace_shortcodes’, ‘frm_change_my_html’, 10, 3); function frm_change_my_html($html, $field, $args){ if ( in_array ( $field[‘type’], array( ‘radio’, ‘checkbox’ ) ) ) { $temp_array = explode(‘/>’, $html); $new_html = ”; foreach ( $temp_array as $key => $piece ) { // Get current for…Continue reading

Insert required and placeholder

add_action(‘frm_field_input_html’, ‘add_input_html’); function add_input_html($field, $echo=true){ $html = ”; if($field[‘id’] == 25){ //change 25 to the ID of your field $html = ‘ required=”required”‘; } if($field[‘type’] == ‘number’){ $html = ‘ placeholder=”2″‘; } if($echo) echo $html; return $html; }Continue reading

Add the field name as input title

add_action(‘frm_field_input_html’, ‘add_input_title’); function add_input_title( $field, $echo = true ) { $html = ”; if($field[‘type’] == ‘text’){ $html = ‘ title=”‘. esc_attr( $field[‘name’] ) .’”‘; } if($echo){ echo $html; } return $html; }Continue reading

Change ReCaptcha Language

add_filter(‘frm_recaptcha_lang’, ‘change_my_captcha_lang’, 10, 2); function change_my_captcha_lang($lang, $field){ if($field[‘id’] == 25) { //change 25 to the ID of the first captcha field to change $lang = ‘fr‘; //change this to the language code of your choice } return $lang; }Continue reading

Add a class to an input field

add_filter(‘frm_field_classes’, ‘add_input_class’, 10, 2); function add_input_class($classes, $field){ if($field[‘id’] == 25){ //change 25 to the ID of your field $classes .= ‘ my_class’; } return $classes; }Continue reading

Default output

add_filter(‘frm_file_icon’, ‘frm_file_icon’, 10, 2); function frm_file_icon($html, $atts){ $image = $atts[‘image’]; $media_id = $atts[‘media_id’]; if ( $image && ! preg_match(“wp-content/uploads/”, $image) ) { //if this is a mime type icon $attachment = get_post($media_id); $label = basename($attachment->guid); $image .= ” <span id=’frm_media_$media_id’…Continue reading

Add label on all files

add_filter(‘frm_file_icon’, ‘frm_file_icon’, 10, 2); function frm_file_icon($html, $atts){ $image = $atts[‘image’]; $media_id = $atts[‘media_id’]; $attachment = get_post($media_id); $label = basename($attachment->guid); //if this is a mime type icon if ( $image && ! preg_match(“wp-content/uploads/”, $image) ) { $image = ” <span id=’frm_media_$media_id’…Continue reading