Change date format

add_filter(‘frm_graph_data’, ‘change_my_graph_date_format’, 10, 2); function change_my_graph_date_format( $data, $atts ) { if ( isset( $atts[‘x_axis’] ) && $atts[‘x_axis’] == ‘created_at’ ) { $wp_date_format = get_option(‘date_format’); $new_format = ‘F d’; for ( $i = 1, $l = count( $data ); $i<$l; $i++…Continue reading

Generate a cumulative graph

add_filter(‘frm_graph_data’, ‘generate_cumulative_graph’, 10, 2); function generate_cumulative_graph( $data, $atts ) { if ( isset( $atts[‘title’] ) && $atts[‘title’] == ‘Cumulative graph’ ) { for ( $i=2, $l=count($data); $i<$l; $i++ ) { $data[ $i ][1]+= $data[ $i-1 ][1]; } } return $data;…Continue reading

Enable Meta Keys for Single Form

add_filter(‘frm_include_meta_keys’, ‘include_meta_keys_for_single_form’, 10, 2); function include_meta_keys_for_single_form( $include_keys, $args ) { if ( $args[‘form_id’] == 364 ) { //replace 364 with Form ID $include_key = true; } return $include_key; }Continue reading

Add a mask to Credit Card

add_filter( ‘frm_input_masks’, ‘add_cc_mask’, 10, 2 ); function add_cc_mask( $masks, $forms_on_page ) { foreach ( $forms_on_page as $form ) { if ( $form->id == 10 ) { // replace 10 with your form id $masks[‘FIELDKEYHERE_cc’] = ‘9999-9999-9999-9999’; // replace FIELDKEYHERE with…Continue reading

Only allow the action once

add_filter( ‘frm_skip_form_action’, ‘stop_multiple_actions’, 20, 2 ); function stop_multiple_actions( $skip_this_action, $args ) { if ( $args[‘action’]->ID == 115 && ! $skip_this_action ) { //replace 115 with your action ID $entry_id = $args[‘entry’]; if ( is_object( $args[‘entry’] ) ) { $entry_id =…Continue reading

Skip based on entry creation date

add_filter( ‘frm_skip_form_action’, ‘stop_multiple_actions’, 20, 2 ); function stop_multiple_actions( $skip_this_action, $args ) { if ( $args[‘action’]->ID == 115 && ! $skip_this_action ) { //replace 115 with your action ID if ( is_object( $args[‘entry’] ) ) { $entry = $args[‘entry’]; } else…Continue reading

Skip if the submitter is Admin

add_filter( ‘frm_skip_form_action’, ‘stop_admin_update_email’, 10, 2 ); function stop_admin_update_email( $skip_this_action, $args ) { if ( $args[‘action’]->ID == 115 ) { //replace 115 with your action ID if ( current_user_can( ‘administrator’ ) ) { $skip_this_action = true; } } return $skip_this_action; }Continue reading

Remove All Meta Columns

add_filter( ‘frm_csv_columns’, ‘remove_id_column’, 10, 2 ); function remove_id_column( $headings, $form_id ) { if ( $form_id == 5 ) { //change 5 to your Form ID unset( $headings[‘created_at’] ); unset( $headings[‘updated_at’] ); unset( $headings[‘user_id’] ); unset( $headings[‘updated_by’] ); unset( $headings[‘is_draft’] );…Continue reading

Skip if one of two fields is empty

add_filter( ‘frm_skip_form_action’, ‘form_action_conditions’, 10, 2 ); function form_action_conditions( $skip_this_action, $args ) { if ( $args[‘action’]->ID == 115 ) {//replace 115 with your action ID if ( is_object( $args[‘entry’] ) ) { $entry = $args[‘entry’]; } else { $entry = FrmEntry::getOne(…Continue reading