Save value with leading zero

add_filter(‘frm_prepare_data_before_db’, ‘save_field_as’, 10, 2); function save_field_as( $value, $field_id ) { $target_field_id = 122; if ( $target_field_id !== (int) $field_id ) { return $value; } if ( is_numeric( $value ) && 1 === strlen( $value ) ) { $value = ‘0’…Continue reading

Prevent redirect action when updating entry

add_filter(‘frm_success_filter’, ‘prevent_redirect_action’ , 10, 2); function prevent_redirect_action( $type, $form, $action ) { if ( $form->id != 5 || ‘update’ != $action ) { return $type; } if ( ‘redirect’ == $type ) { return ‘message’; } if ( is_array( $type…Continue reading

Apply a view for the attached PDF

add_filter( ‘frm_pdfs_email_attachment_args’, ‘add_view_to_attached_pdf’, 10, 2 ); function add_view_to_attached_pdf( $pdf_args, $args ) { $pdf_args[‘view’] = 10; // ID of view. $pdf_args[‘id’] = $args[‘entry’]->id; // Do this to show the detail view, otherwise, it shows the listing view. return $pdf_args; }Continue reading

Change the attached PDF file name

add_filter( ‘frm_pdfs_email_attachment_args’, ‘change_attached_pdf_file_name’, 10, 2 ); function change_attached_pdf_file_name( $pdf_args, $args ) { $pdf_args[‘filename’] = ‘stuff’; return $pdf_args; }Continue reading

Wrap all grid items inside a custom wrapper

add_filter( ‘frm_display_inner_content_before_add_wrapper’, ‘grid_view_custom_wrapper’, 10, 3 ); function grid_view_custom_wrapper( $inner_content, $view, $args ) { if ( ! empty( $args[‘is_grid_view’] ) ) { $inner_content = ‘<div class=”frm_grid_container”>’ . $inner_content . ‘</div>’; } return $inner_content; }Continue reading

Use true type font

add_filter(‘frm_pdfs_css’, ‘ttf_font_pdfs_css’, 10, 2); function ttf_font_pdfs_css( $css, $args ) { $custom_css = ” @font-face { font-family: ‘Seto’; font-style: normal; font-weight: normal; src: url(https://github.com/googlefonts/chinese/raw/gh-pages/fonts/SetoFont/setofont.ttf) format(‘truetype’); } body { font-family: Seto, sans-serif; } “; return $css . $custom_css; }Continue reading

Use custom font with CSS selector

add_filter(‘frm_pdfs_css’, ‘custom_font_pdfs_css_selector’,10, 2); function custom_font_pdfs_css_selector( $css, $args ) { $custom_css = ‘.custom-language-text { font-family: Dejavu Sans, sans-serif; }’; return $css . $custom_css; }Continue reading

Exclude some On Submit actions

add_filter(‘frm_get_met_on_submit_actions’, ‘frm_exclude_on_submit_actions’, 10, 2); function frm_exclude_on_submit_actions( $met_actions, $args ) { foreach ( $met_actions as $index => $action ) { if ( 10 == $action->ID ) { unset( $met_actions[ $index ] ); } } return $met_actions; }Continue reading

Show only future dates in a lookup field

add_filter( ‘frm_filtered_lookup_options’, ‘show_future_date’, 10, 2 ); function show_future_date( $options, $args ) { if ( $args[‘field’]->id == 20116 ) { // change 20116 to the ID of the date field in the other form foreach ( $options as $k => $option…Continue reading