Force show form for message action

add_filter(‘frm_get_run_success_action_args’, ‘show_form_success_action_args’, 10, 3); function show_form_success_action_args( $new_args, $args, $action ) { if ( ‘message’ === $new_args[‘conf_method’] ) { $new_args[‘form’]->options[‘show_form’] = 1; } return $new_args; }Continue reading

Add custom data to the global JS

add_filter(‘frm_acf_global_js_data’, ‘acf_global_js_data’, 10, 2); function acf_global_js_data( $data, $args ) { $data[‘form_object’] = FrmForm::getOne( $args[‘form_id’] ); $data[‘strings’][‘custom_string’] = ‘Your custom string’; $data[‘custom_data’] = ‘Your custom data’; return $data; }Continue reading

Add custom data to the form action JS

add_filter(‘frm_acf_form_action_js_data’, ‘acf_form_action_js_data’, 10, 2); function acf_form_action_js_data( $data, $args ) { $data[‘form_action_id’] = $args[‘form_action’]->ID; return $data; }Continue reading

Turn off file referer check for Zapier

add_filter( ‘frm_check_file_referer’, ‘turnoff_file_referer_check_for_zapier’ ); function turnoff_file_referer_check_for_zapier( $check_referer ) { if ( ! $check_referer ) { return false; } return FrmAppHelper::get_server_value( ‘HTTP_USER_AGENT’ ) !== ‘Zapier’; }Continue reading

Filter the canonical URL for a published View

add_filter( ‘get_canonical_url’, ‘filter_canonical_url_for_view_inside_page’, 10, 2 ); function filter_canonical_url_for_view_inside_page( $canonical_url, $post ) { $target_post_id = 180; //Replace 180 with the target page ID $target_view_id = 179; //Replace 179 wth the specific View ID if ( $target_post_id !== $post->ID ) { return…Continue reading

Change email fields to lowercase

add_filter(‘frm_validate_field_entry’, ’email_field_lowercase_validation’, 8, 3); function email_field_lowercase_validation($errors, $posted_field, $posted_value){ if($posted_field->type == ’email’){ $_POST[‘item_meta’][$posted_field->id] = mb_strtolower($posted_value); } return $errors; }Continue reading

Convert number field value to integer

add_filter(‘frm_acf_frm_to_acf’, ‘frm_acf_frm_to_integer’ , 10, 2); function frm_acf_frm_to_integer( $new_value, $args ) { if ( ‘number’ === $args[‘acf_field’][‘type’] && ‘number’ === $args[‘frm_field’]->type ) { $new_value = intval( $new_value ); } return $new_value; }Continue reading