Choose field for entry name

add_filter(‘frm_pre_create_entry’, ‘frm_choose_field_entry_name’); function frm_choose_field_entry_name( $values ) { $target_form_id = 781; // change 781 to your form ID if ( $target_form_id === (int) $values[‘form_id’] ) { $target_field_id = 4529; // change 4529 to the field that you want to use for…Continue reading

Set a custom enctype for a specific form

add_filter( ‘frm_form_enctype’, ‘custom_form_enctype’, 10, 2 ); function custom_form_enctype( $enctype, $form ) { $target_form_id = 832; // change 832 to your form ID. if ( $target_form_id === (int) $form->id ) { $enctype = ”; } return $enctype; }Continue reading

Adjust values displayed in cart for specific field types

add_filter( ‘wc_fp_cart_item_data’, ‘modify_frm_woo_display_for_number_fields’, 10, 2 ); function modify_frm_woo_display_for_number_fields( $values, $args ) { if ( $args[‘field’]->type ==”number”) { $end_position = strpos( $values[‘display’], ‘ (‘ ); $values[‘display’] = substr( $values[‘display’], 0, $end_position ); } return $values; }Continue reading

Add custom formatter class for email

add_filter( ‘frm_entry_formatter_class’, ‘use_custom_formatter_class’, 10, 2 ); function use_custom_formatter_class( $class, $atts ) { if ( ‘custom’ === $atts[‘format’] ) { return ‘CustomEntryFormatter’; } return $class; } class CustomEntryFormatter extends FrmEntryFormatter { public function __construct( $atts ) { parent::__construct( $atts ); $this->format…Continue reading

Add unique validation when saving drafts

add_filter(‘frm_validate_entry’, ‘validate_unique_field’, 10, 2 ); function validate_unique_field( $errors, $values ) { if ( ! FrmProFormsHelper::saving_draft() ) { return $errors; } $field_id = 795; // change this to the ID of the unique field if ( ! isset( $values[‘item_meta’][ $field_id ]…Continue reading

Basic example

add_filter(‘frm_order_lookup_options’, ‘frm_set_custom_lookup_order’, 20, 2); function frm_set_custom_lookup_order( $values, $order ) { if ( $order == ‘ascending’ ) { sort( $values ); } return $values; }Continue reading

Skip start page

add_filter(‘frm_filter_final_form’, ‘skip_start_page’, 15); function skip_start_page( $form ) { $form = str_replace( ‘class=”frm_active_chat_field frm_chat_start_page”‘, ‘style=”display: none;” class=”frm_active_chat_field frm_chat_start_page”‘, $form ); return $form; }Continue reading