Set the Formidable stylesheet

add_filter(‘get_frm_stylesheet’, ‘my_custom_stylesheet’, 30, 2); function my_custom_stylesheet($previous_css, $location=’header’){ global $frm_vars; if ( ! isset($frm_vars[‘css_loaded’]) || ! $frm_vars[‘css_loaded’] ) { $css_file[‘formidable’] = admin_url(‘admin-ajax.php’) . ‘?action=frmpro_css’; } return $css_file; }Continue reading

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

Blackout specific dates

add_action(‘frm_date_field_js’, ‘limit_my_date_field’); function limit_my_date_field($field_id){ if ($field_id == ‘field_4k4w4j‘){ //change 4k4w4j to the key of your date field echo ‘,beforeShowDay: function (date){var d = date.getFullYear() + “-” + date.getMonth() + “-” + date.getDate();return [(d != “2014-8-28” && d != “2014-9-12” &&…Continue reading

Custom, dynamic date range

add_action(‘frm_date_field_js’, ‘limit_my_date_field’); function limit_my_date_field($field_id){ if($field_id == ‘field_FIELDKEY‘){ //change FIELDKEY to the key of your date field echo ‘,minDate:0,maxDate:+60‘; } }Continue reading

Use shortcode throughout HTML in form

add_filter( ‘frm_filter_final_form’, ‘filter_hide_this’ ); function filter_hide_this( $form ) { global $shortcode_tags; $original_shortcodes = $shortcode_tags; $limited_shortcodes = array( ‘hidethis’ => $shortcode_tags[‘hidethis’] ); $shortcode_tags = $limited_shortcodes; $form = do_shortcode( $form ); $shortcode_tags = $original_shortcodes; return $form; } add_filter( ‘frm_do_html_shortcodes’, ‘__return_false’ );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