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

Basic Usage

add_filter(‘frm_replace_shortcodes’, ‘frm_change_my_html’, 10, 3); function frm_change_my_html($html, $field, $args){ if($args[‘form’][‘id’] == 10){ //change 10 the id of the form to change $html .= ‘add additional content here ‘; } return $html; }Continue reading

Add Header Image to Emails

add_filter(‘frm_email_message’, ‘add_email_header’, 10, 2); function add_email_header($message, $atts) { //edit the email header image source to include an image URL of your choice $email_header = ‘<img src=”http://www.yoursite.com/images/email-header.jpg” alt=”Header” /><br />’; $message = $email_header . $message; return $message; }Continue reading

Offset Autoscroll

add_filter(‘frm_scroll_offset’, ‘frm_scroll_offset’); function frm_scroll_offset(){ return 170; //adjust this as needed }Continue reading

Disable Autoscroll

add_filter(‘frm_scroll_offset’, ‘frm_scroll_offset’); function frm_scroll_offset(){ return -1; //this will disable the autoscroll }Continue reading

Disable readonly for Admins

add_action(‘formidable_shortcode_atts’, ‘frm_admin_readonly’, 20, 2); function frm_admin_readonly( $atts, $all_atts ) { if ( $atts[‘readonly’] == ‘administrator’ ) { global $frm_vars; if ( current_user_can(‘administrator’) ) { $frm_vars[‘readonly’] = ‘disabled’; } else { $frm_vars[‘readonly’] = false; } } }Continue reading