Add custom class to a form

add_filter( ‘frm_add_form_style_class’, ‘add_style_class’, 10, 3 ); function add_style_class( $class, $style, $args = array() ) { $target_form_id = 439; // change 439 to your form ID. if ( ! empty( $args[‘form’] ) && ! empty( $args[‘form’][‘fields’] ) ) { $field =…Continue reading

Check if a user exists or not

add_filter(‘frm_filter_view’, ‘check_if_users_exists’, 10, 2); function check_if_users_exists( $view ) { $target_view_id = 380; // change this to your View ID. if ( $target_view_id !== (int) $view->ID ) { return $view; } $target_form_id = $view->frm_form_id; global $wpdb; $item_ids = FrmDb::get_col( $wpdb->prefix .…Continue reading

Set quiz field as correct

add_filter( ‘frm_quiz_is_correct’, ‘is_quiz_correct’, 10, 2 ); function is_quiz_correct( $is_correct, $args ) { $target_field_id = 1246; // Change 1246 with your field ID if ( $target_field_id === (int) $args[‘field’]->id ) { $is_correct = true; } return $is_correct; }Continue reading

Change progress bar text

add_filter(‘frm_chat_progress_text’, ‘frm_chat_change_progress_text’, 10, 2); function frm_chat_change_progress_text( $text, $form ) { $target_form_id = 225; // change 225 to your form ID. if ( $target_form_id === (int) $form->id ) { return ‘[current] / [total]’; } return $text; }Continue reading

Show progress bar text with percent sign

add_filter(‘frm_chat_progress_text’, ‘frm_chat_show_percent_sign’, 10, 2); function frm_chat_show_percent_sign( $text, $form ) { $target_form_id = 225; // change 225 to your form ID. if ( $target_form_id === (int) $form->id ) { return ‘[current show=percent]%’; } return $text; }Continue reading

Remove errors in the admin

add_filter(‘frm_validate_entry’, ‘remove_errors_in_admin_area’, 20, 2); function remove_errors_in_admin_area($errors, $values){ if ( $values[‘form_id’] == 99 && is_admin() ) { //Change 99 to the ID of your form return array(); } return $errors; }Continue reading

Set the default value of a calculated field

add_filter( ‘frm_get_default_value’, ‘add_a_value_to_default’, 10, 5 ); function add_a_value_to_default( $new_value, $field, $dynamic_default, $allow_array, $args = array() ) { if ( ! empty( $args[‘is_calc’] ) ) { $new_value = 500; } return $new_value; }Continue reading

Add extra custom HTML to start page

add_filter(‘frm_chat_start_page_content’, ‘frm_chat_add_html’, 10, 2); function frm_chat_add_html( $start_page_content, $args ) { $target_form_id = 310; // change 310 to your form ID. if ( $target_form_id === (int) $args[‘form’]->id ) { $start_page_content .= ‘<br>’; $start_page_content .= ‘Additional start page content’; } return $start_page_content;…Continue reading

Add gallery to WooCommerce product

add_action(‘frm_after_create_entry’, ‘frm_add_gallery_to_product’, 60, 2); function frm_add_gallery_to_product( $entry_id, $form_id ) { if ( $form_id == 1705 ) {// Replace 1705 with the ID of your form $entry = FrmEntry::getOne( $entry_id ); if ( ! $entry->post_id ) { return; } update_post_meta($entry->post_id, ‘_product_image_gallery’,…Continue reading