Limit number of uploaded files

add_filter(‘frm_validate_field_entry’, ‘validate_number_of_files’, 10, 3); function validate_number_of_files($errors, $field, $value){ if ( in_array($field->id, array(25,26,27)) && $field->type == ‘file’ && (isset($_FILES[‘file’.$field->id])) && !empty($_FILES[‘file’.$field->id][‘name’])){ $files = (array)$_FILES[‘file’. $field->id][‘name’]; $count = 0; foreach($files as $n){ if(!empty($n)) $count++; } $existing = $_POST[‘item_meta’][$field->id]; if($existing){ foreach($existing as $e){…Continue reading

Limit the number of times a date can be selected

add_filter(‘frm_validate_field_entry’, ‘my_custom_validation’, 10, 3); function my_custom_validation($errors, $posted_field, $posted_value){ if($posted_field->id == 125 and !is_admin()){ //change 125 to the ID of the date field $frmpro_settings = FrmProAppHelper::get_settings(); $selected_date = FrmProAppHelper::convert_date($posted_value, $frmpro_settings->date_format, ‘Y-m-d’); //get all the entries for that date $entries_for_date = FrmEntryMeta::get_entry_metas_for_field(125,…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

Show full image instead of thumbnail

add_filter( ‘frm_show_it’, ‘custom_frm_show_it’, 10, 3 ); function custom_frm_show_it( $html, $value, $args ) { if ( $args[‘field’]->id == 30 ) { //change 30 to the id of the upload field in the other form $media_ids = explode( ‘, ‘, $args[‘value’] );…Continue reading

Show option label

add_filter(‘frm_show_it’, ‘dynamic_list_show_option_label’, 10, 3); function dynamic_list_show_option_label( $html, $value, $args ){ if ( $args[‘field’]->id == 485 && $args[‘field’]->field_options[‘separate_value’] ) { foreach ( $args[‘field’]->options as $option ) { if ( is_array( $option ) && isset( $option[‘value’] ) && $option[‘value’] == $value )…Continue reading

Hide a field depending on a value in another

add_filter(‘frm_field_type’, ‘change_my_field_type’, 10, 3); function change_my_field_type($type, $field, $value){ if($field->id == 25){ //change 25 to the id of the field to conditionally hide global $my_required_id, $user_ID; if($my_required_id == $user_ID) //if current user is not an editor $type = ‘hidden’; //hide this…Continue reading