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

Blackout days of the week

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 ‘,beforeShowDay: function(date){var day=date.getDay();return [(day != 2 && day != 4)];}’; } }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

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

Only show form to logged-out users

add_action(‘frm_display_form_action’, ‘close_my_form’, 8, 3); function close_my_form($params, $fields, $form){ remove_filter(‘frm_continue_to_new’, ‘__return_false’, 50); if($form->id == 6){ //remove this section or change 6 to a form ID if(is_user_logged_in()){ echo ‘You are logged in’; add_filter(‘frm_continue_to_new’, ‘__return_false’, 50); } } }Continue reading