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

Black out weekends

add_filter(‘frm_selectable_dates’, ‘frm_black_out_weekends’, 10, 2); function frm_black_out_weekends( $selectable, $args ) { if ( $args[‘field’]->field_key == ‘pcm7rl3‘ ) { //replace pcm7rl3 with your field key $selectable = ‘(day != 0 && day != 6)’; //where 0 & 6 are the days of…Continue reading

Add OnClick event

add_action(‘frm_submit_button_action’, ‘your_function_name’); function your_function_name($form){ if($form->id == 5){ //change 5 to the ID of the form you would like this inserted in echo ‘ onclick=”do something”‘; } }Continue reading

Replace Form Success/Update Message

add_filter( ‘frm_main_feedback’, ‘frm_main_feedback’, 20, 3 ); function frm_main_feedback( $message, $form, $entry_id ) { if ( $form->id == 125 ) { //Replace with the ID of your form $message = ‘Change the message here’; } return $message; }Continue reading

Add a class to a form

add_action( ‘frm_form_classes’, ‘frm_form_classes’ ); function frm_form_classes( $form ) { if ( $form->id == 25 ) { //Change 25 to the ID of your form echo ‘new_class’; } }Continue reading

Add a class to all forms

add_filter(‘frm_form_fields_class’, ‘add_form_class’, 10, 2); function add_form_class($classes, $form_values){ $classes .= ‘ my_class’; //replace my_class with the name of your class return $classes; }Continue reading

Load a style

add_filter(‘frm_ajax_load_styles’, ‘frm_ajax_load_styles’); function frm_ajax_load_styles($styles){ $styles[] = ‘dashicons’; // change this to the enqueued name of the style to load return $styles; }Continue reading

Add Hidden Field

add_action(‘frm_entry_form’, ‘add_hidden_field’); function add_hidden_field( $form ){ echo ‘<input type=”hidden” name=”my_field_name” value=”my_field_value”>’; }Continue reading