Minimize the form without the shortcode
add_filter( ‘frm_filter_final_form’, ‘auto_minimize_forms’ ); function auto_minimize_forms( $form ) { $form = str_replace( array( “rn”, “r”, “n”, “t”, ‘ ‘ ), ”, $form ); return $form; }Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter( ‘frm_filter_final_form’, ‘auto_minimize_forms’ ); function auto_minimize_forms( $form ) { $form = str_replace( array( “rn”, “r”, “n”, “t”, ‘ ‘ ), ”, $form ); return $form; }Continue reading
add_action(‘frm_entries_footer_scripts’, ‘set_custom_limit’, 20, 2); function set_custom_limit($fields, $form){ if($form->id != 5) return; //change 5 to the ID of your form ?> //add javascript here <?php }Continue reading
add_action(‘frm_entries_footer_scripts’, ‘set_custom_limit’, 20, 2); function set_custom_limit($fields, $form){ if($form->id != 5) return; //change 5 to the ID of your form ?> jQuery(document).ready(function($){ $(‘#field_FIELDKEYHERE’).change(function(){ if($(this).val().length > 15) $(this).val($(this).val().substr(0, 15)); }); }); <?php }Continue reading
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
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
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
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_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
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_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