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

Select current user’s option in Dynamic field

add_filter(‘frm_get_default_value’, ‘auto_populate_dynamic_field’, 10, 2); function auto_populate_dynamic_field($new_value, $field){ if ( $field->id == 25 ) { //change 25 to the ID of the Dynamic field global $wpdb; $user = wp_get_current_user(); $entry_id = $wpdb->get_var( $wpdb->prepare( “SELECT id FROM ” . $wpdb->prefix . “frm_items…Continue reading

Hide a field from non-editors

add_filter(‘frm_field_type’, ‘change_my_field_type’, 10, 2); function change_my_field_type($type, $field){ if(in_array($field->id, array(125,126,127))){ //change 125, 126, and 127 to the ids of fields to hide if(!is_admin() and !current_user_can(‘editor’))//if current user is not an editor $type = ‘hidden’; //hide the fields } return $type; }Continue reading

Hide a field when editing

add_filter(‘frm_field_type’, ‘change_my_field_type’, 10, 2); function change_my_field_type($type, $field){ if(in_array($field->id, array(125, 126))){ //change 125 and 126 to the ids of the fields to hide global $frm_vars; if((!is_admin() || defined(‘DOING_AJAX’)) && isset($frm_vars[‘editing_entry’]) && $frm_vars[‘editing_entry’]) { //if not in admin area and editing an…Continue reading

Hide a field when not editing

add_filter(‘frm_field_type’, ‘change_my_field_type’, 10, 2); function change_my_field_type($type, $field){ if(in_array($field->id, array(125, 126))){ //change 125 and 126 to the ids of the fields to hide global $frm_vars; if((!is_admin() || defined(‘DOING_AJAX’)) && (!isset($frm_vars[‘editing_entry’]) || !$frm_vars[‘editing_entry’])) { //if not in admin area and not editing…Continue reading

Make field read-only for non-administrators

add_filter(‘frm_setup_new_fields_vars’, ‘frm_set_read_only_on_create’, 9, 2); add_filter(‘frm_setup_edit_fields_vars’, ‘frm_set_read_only_on_create’, 9, 2); function frm_set_read_only_on_create( $values, $field ){ // If on the back-end, keep fields editable if ( FrmAppHelper::is_admin() || current_user_can( ‘administrator’ ) ) { return $values; } // If on front-end, make specific fields…Continue reading