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 icon and instruction

add_filter( ‘frm_filter_final_form’, ‘remove_conversational_html’, 15 ); function remove_conversational_html( $html ) { // Remove enter icons $html = preg_replace( ‘/<svg(.*?)d=”M15.3 6c0 .7-.3 1.2-.7 1.7a2.2 2.2 0 0 1-1.7.7H7.4v2.3L.6 7.5l6.8-3.2v2.3H12c.3 0 .6-.1.8-.3.3-.2.4-.5.4-.8V.7h2V6Z”(.*?)\/><\/svg>/’, ”, $html, 2 ); // Remove the “Shift+Tab” instruction $html =…Continue reading

Wrap the value of checkbox field in a span

add_filter( ‘frm_entries_column_value’, ‘wrap_column_value_in_span’ ); function wrap_column_value_in_span( $val, $args ) { $field = FrmField::getOne( $args[‘col_name’] ); if ( ! $field ) { return $val; // Field does not exist or this is a specific column. } if ( ‘checkbox’ === $field->type…Continue reading

Replace [date] or [user_id] before sending an API request

add_action( ‘frm_trigger_api_action’, ‘add_shortcodes_to_api_request’, 1 ); function add_shortcodes_to_api_request() { add_filter( ‘frm_content’, function( $value ) { $value = str_replace( ‘[date]’, FrmProAppHelper::get_date( ‘Y-m-d’ ), $value ); $value = str_replace( ‘[user_id]’, get_current_user_id(), $value ); return $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

Conditionally 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 && ‘Alternative answer’ === $args[‘value’] ) { // Change the text for…Continue reading

Trigger an action on complete payment

add_action( ‘frm_payment_status_complete’, ‘frm_trigger_action_payment_complete’ ); function frm_trigger_action_payment_complete( $atts ) { $target_action_id = 450; // change 450 to your payment action ID if ( $atts[‘payment’]->status == ‘complete’ && $target_action_id === (int) $atts[‘payment’]->action_id ) { $to = get_option( ‘admin_email’ ); $subject = ‘Payment…Continue reading

Change user role on complete payment

add_action( ‘frm_payment_status_complete’, ‘frm_change_the_role’ ); function frm_change_the_role( $atts ) { $new_role = ‘contributor’; // change contributor to the new user role $entry = isset( $atts[‘entry’] ) ? $atts[‘entry’] : $atts[‘payment’]->item_id; if ( is_numeric( $entry ) ) { $entry = FrmEntry::getOne( $entry…Continue reading