Show comma-separate values as a list

add_filter( ‘frmpro_fields_replace_shortcodes’, ‘frm_show_list’, 10, 4 ); function frm_show_list( $replace_with, $tag, $atts, $field ) { if ( ! isset( $atts[‘show_list’] ) ) { return $replace_with; } $sep = isset( $atts[‘sep’] ) ? $atts[‘sep’] : ‘<br>’; return str_replace( ‘, ‘, $sep, $replace_with…Continue reading

Change a word

add_filter( ‘frm_filter_final_form’, ‘change_edit_label’ ); function change_edit_label( $form ){ $form = str_replace( ‘Edit’, ‘Revise’, $form ); return $form; }Continue reading

Store file upload URL in another field

add_filter(‘frm_validate_field_entry’, ‘filename_to_field’, 10, 3); function filename_to_field($errors, $posted_field, $posted_value){ if ( $posted_field->id == 25 ) { //change 25 to the ID of the field to store the file url in $_POST[‘item_meta’][$posted_field->id] = wp_get_attachment_url( $_POST[‘item_meta’][20] ); //Change 20 to the ID of…Continue reading

Add class to form based on param

add_action( ‘frm_form_classes’, ‘frm_add_new_class’ ); function frm_add_new_class( $form ) { if ( ! isset( $_GET[‘add_class’] ) ) { return; } $new_class = $_GET[‘add_class’]; $new_class = utf8_decode( urldecode( $new_class ) ); echo esc_html( $new_class ); }Continue reading

Modify the search value

add_filter( ‘frm_filter_admin_entries’, ‘custom_query’, 10, 2 ); function custom_query( $query, $args ) { $fid = ‘id’; if ( $args[‘field_id’] === $fid ) { $query[‘it.’ . $fid][0] = ‘new value to search’; } return $query; }Continue reading

Add new search option

add_filter( ‘frm_admin_search_options’, ‘add_search_option’, 10, 2 ); function add_search_option( $options, $args ) { array_push( $options, ‘IP’ ); return $options; }Continue reading

Save a value from the response

add_action( ‘frmapi_post_response’, ‘frm_save_api_response’, 10, 3 ); function frm_save_api_response( $response, $entry, $form_action ) { $body = json_decode($response[“body”], true); $returned_id = $body[“CHANGEME”]; // this line will change based on the API you are sending to if ( $returned_id ) { FrmProEntryMeta::update_single_field( array(…Continue reading

Save the entry ID in a field

add_action(‘frm_after_create_entry’, ‘frm_add_entry_id’, 42, 2); function frm_add_entry_id($entry_id, $form_id){ if ( $form_id == 221 ) { //change 221 to the ID of your form FrmEntryMeta::add_entry_meta( $entry_id, 1819, “”, $entry_id);//change 1819 to the ID of the field in which you want to store…Continue reading

Remove a field option based on current date

add_filter(‘frm_setup_new_fields_vars’, ‘remove_field_option_by_date’, 30, 2); add_filter(‘frm_setup_edit_fields_vars’, ‘remove_field_option_by_date’, 30, 2); function remove_field_option_by_date( $values, $field ) { $today = time(); $close_date = strtotime ( “2020-06-20” ); // change 2020-06-20 to the date after which the option should be removed if ($field->id == 13677…Continue reading

Change the header row in a CSV export

add_filter( ‘frm_export_csv_table_heading’, ‘frm_change_csv_export_heading’, 10, 2 ); function frm_change_csv_export_heading( $heading, $view ) { if ( $view->ID !== 65 ) { return $heading; } return ‘<tr><th>Name</th><th></th><th>Title</th></tr>’ }Continue reading