Remove an option

add_filter(‘frm_setup_new_fields_vars’, ‘remove_field_option’, 30, 2); add_filter(‘frm_setup_edit_fields_vars’, ‘remove_field_option’, 30, 2); function remove_field_option( $values, $field ) { if ( $field->id == 25 ) { // change 25 to your field id $options_to_remove = array( ‘12:00 PM‘, ‘12:30 PM‘ ); foreach ( $options_to_remove as…Continue reading

Change Date Format

add_filter(‘frm_datepicker_formats’, ‘add_custom_frm_format’); function add_custom_frm_format($formats) { $formats[‘j M, Y‘] = ‘d M, yy‘; //change PHP and Datepicker formats return $formats; }Continue reading

Show all fields on the final page of a multi-paged form

add_filter(‘frm_get_paged_fields’, ‘get_extra_form_fields’, 30, 3); function get_extra_form_fields($fields, $form_id, $error=false){ if($form_id == 25){ //change 25 to the id of the form to change $prev_page = FrmAppHelper::get_param(‘frm_page_order_’. $form_id, false); if($prev_page > 3){ //change 3 to a number higher than the order of second…Continue reading

Remove page breaks from the admin

add_filter( ‘frm_get_paged_fields’, ‘remove_my_breaks’, 9, 2 ); function remove_my_breaks( $fields, $form_id ) { if ( ! is_admin() ) { return $fields; } if ( $form_id == 12 ) { // change 12 to the ID of your form remove_filter( ‘frm_get_paged_fields’, ‘FrmProFieldsHelper::get_form_fields’,…Continue reading

Dynamically populate checkbox field

add_filter(‘frm_setup_new_fields_vars’, ‘frm_set_checked’, 20, 2); function frm_set_checked($values, $field){ if($field->id == 125){//Replace with the ID of your field $values[‘value’] = array($_GET[‘color1‘], $_GET[‘color2‘]); //Replace color1 and color2 with the names of your parameters in the URL } return $values; }Continue reading

Display User ID dropdown on front-end for admin

add_filter(‘frm_setup_new_fields_vars’, ‘show_user_dropdown’, 15, 2); add_filter(‘frm_setup_edit_fields_vars’, ‘show_user_dropdown’, 15, 3); function show_user_dropdown($values, $field, $entry_id=false){ $action = FrmAppHelper::get_param( ‘action’, ”, ‘post’, ‘sanitize_text_field’ ); $creating_field = FrmAppHelper::doing_ajax() && ( $action === ‘frm_insert_field’ || $action === ‘frm_duplicate_field’ ); if ( $values[‘type’] == ‘user_id’ && !…Continue reading

Filter Dynamic Field

add_filter(‘frm_setup_new_fields_vars’, ‘filter_dfe_options’, 25, 2); function filter_dfe_options($values, $field){ if ( $field->id == 125 && !empty( $values[‘options’] ) ) {//Replace 125 with the ID of your Dynamic field $temp = $values; $temp[‘form_select’] = 30;//change 30 to the id of the field (in…Continue reading

Show admin all options in a filtered dynamic field

add_filter(‘frm_setup_new_fields_vars’, ‘do_not_restrict_admin’, 20, 2); function do_not_restrict_admin( $values, $field ) { if ( $values[‘restrict’] && current_user_can(‘administrator’) ) { if ( $values[‘type’] == ‘data’ && in_array( $values[‘data_type’], array( ‘select’, ‘radio’, ‘checkbox’ ) ) && is_numeric( $values[‘form_select’] ) ) { $values[‘restrict’] = 0;…Continue reading

Display two fields in a dynamic field

add_filter(‘frm_setup_new_fields_vars’, ‘customize_dfe’, 25, 2); function customize_dfe( $values, $field ) { if ( $field->id == 125 && !empty( $values[‘options’] ) ){//Replace 125 with the ID of your dynamic field $temp_values = $values; $temp_values[‘form_select’] = 30; //change 30 to the id of…Continue reading

Change the blank option label in Dynamic field

add_filter(‘frm_setup_new_fields_vars’, ‘change_dynamic_blank_option’, 25, 2); function change_dynamic_blank_option($values, $field){ if ( in_array( $field->id, array( 100,101,102 ) ) ) {//Replace 100, 101, and 102 with the IDs of your Dynamic fields if ( empty( $values[‘options’] ) ) { return $values; } $values[‘options’][”] =…Continue reading