Check nonce on form submission

add_filter( ‘frm_validate_entry’, ‘check_nonce_on_submit’, 10, 2 ); function check_nonce_on_submit( $errors, $values ) { $target_form_id = 117; // Replace 117 with the ID of your form. if ( $target_form_id === $values[‘form_id’] && ! wp_verify_nonce( $values[ ‘frm_submit_entry_’ . $values[‘form_id’] ], ‘frm_submit_entry_nonce’ ) )…Continue reading

Rename Name fields on export

add_filter( ‘frm_csv_columns’, ‘change_column_name’, 10, 2 ); function change_column_name( $headings, $form_id ) { $name_field_id = 2248; //Replace 1152 with your Name field ID $headings[ $name_field_id . ‘_first’ ] = ‘First name column’; $headings[ $name_field_id . ‘_last’ ] = ‘Last name column’;…Continue reading

Change the array separator

add_filter(‘frm_pdfs_show_args’, ‘change_array_separator’, 10, 2); function change_array_separator( $show_args, $args ) { $show_args[‘array_separator’] = ‘|’; return $show_args; }Continue reading

Save the ID of created post in a field

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

Filter graphs with y-min parameter

function filter_graph_data_to_match_min_x( $data, $atts ) { if ( ! isset( $atts[‘x_min’] ) ) { return $data; } return array_values( array_filter( $data, function( $row ) use ( $atts ) { return $row[1] >= floatval( $atts[‘x_min’] ); } ) ); } add_filter(…Continue reading

Set post status based on user role

add_filter( ‘frm_new_post’, ‘set_post_status’, 10, 2 ); function set_post_status( $post, $args ) { if ( $args[‘form’]->id == 68 ) { //change 68 to the ID of your form $role = $_POST[‘item_meta’][41065]; //Change 41065 to the ID of the hidden field with…Continue reading

Basic Example

add_filter(‘frm_pdfs_access_code_max_days’, ‘filter_access_code_max_days’); function filter_access_code_max_days() { return 7; // Replace 7 with the number of days. }Continue reading

Fix images from unsafe HTTPs

add_filter(‘frm_pdfs_dompdf_args’, ‘fix_images_unsafe_https’ ); function fix_images_unsafe_https( $args ) { if ( ! isset( $args[‘http_context’] ) ) { $args[‘http_context’] = array(); } if ( ! isset( $args[‘http_context’][‘ssl’] ) ) { $args[‘http_context’][‘ssl’] = array(); } $args[‘http_context’][‘ssl’][‘verify_peer’] = false; return $args; }Continue reading