Order options by entry ID

add_filter(‘frm_data_sort’, ‘frm_my_data_sort’, 21, 2); function frm_my_data_sort( $options, $atts ) { if ( $atts[‘dynamic_field’][‘id’] == 100 ) { //change 100 to the ID of the Dynamic field ksort( $options );//sorts options by entry ID } return $options; }Continue reading

Remove duplicates from Dynamic field

add_filter(‘frm_data_sort’, ‘frm_remove_duplicates’, 21, 2); function frm_remove_duplicates( $options, $atts ) { if ( $atts[‘dynamic_field’][‘id’] == 100) { //change 100 to the ID of the Dynamic field $options = array_unique( $options ); } return $options; }Continue reading

Add custom option set

add_filter(‘frm_bulk_field_choices’, ‘add_custom_frm_options’); function add_custom_frm_options( $opts ){ $opts[‘Set Name’] = array(‘Option 1’, ‘Option 2’, ‘Option 3’); return $opts; }Continue reading

Only include categories with no parent

add_filter(‘frm_get_categories’, ‘frm_order_cats’, 10, 2); function frm_order_cats($args, $field){ if($field[‘id’] == 25){ //change 25 to the ID of your field $args[‘parent’] = 0; } return $args; }Continue reading

Blackout Time Blocks

add_filter(‘frm_allowed_times’, ‘change_my_business_hours’, 10, 2); function change_my_business_hours($remove, $values) { if ( $values[‘time_field’] == ‘field_mflcim’) { //change to field key for your time field $week_day = date(‘l’, strtotime($values[‘date’])); $times_to_remove = array( ‘Monday’ => array(’05:15 PM’, ’05:30 PM’, ’05:45 PM’, ’06:00 PM’), //continue…Continue reading

Change to like

add_filter( ‘frm_set_comparison_type_for_lookup’, ‘customize_lookup_value_retrieval’, 10, 3); function customize_lookup_value_retrieval( $type, $parent_field, $child_field ) { if ( $parent_field->id == 123 ) { $type = ‘like’; } return $type; }Continue reading

Customize a Dynamic List field

add_filter(‘frm_show_it’, ‘custom_dynamic_list_display’, 10, 3); function custom_dynamic_list_display( $html, $value, $args ) { if ( $args[‘field’]->id == 30 ) { //change 30 to the id of the linked field ID // Customize displayed value here } return $html; }Continue reading

Set field value when editing

add_filter(‘frm_setup_edit_fields_vars’, ‘frm_set_edit_val’, 20, 3); function frm_set_edit_val( $values, $field, $entry_id ) { if ( $field->id == 171 ) { //Replace 171 with your field ID // If on the back-end, don’t adjust field value if ( FrmAppHelper::is_admin() ) { return $values;…Continue reading

Set the default value of a field

add_filter(‘frm_get_default_value’, ‘my_custom_default_value’, 10, 3); function my_custom_default_value( $new_value, $field, $is_default ) { if ( $field->id == 25 && $is_default ) { //change 25 to the ID of the field $new_value = ‘default’; //change ‘default’ to your default value } return $new_value;…Continue reading

Conditionally switch default value

add_filter(‘frm_get_default_value’, ‘switch_my_default_value’, 10, 2); function switch_my_default_value( $new_value, $field ){ if ( in_array( $field->id, array( 25, 26, 27 ) ) ) { if ( isset( $_GET[‘pass_entry’] ) ) { $new_value = do_shortcode( ‘[frm-field-value field_id=’ . $field->id . ‘ entry=pass_entry]’ ); }…Continue reading