Basic Example

add_filter(‘frm_graph_value’, ‘my_custom_graph_value’, 10, 2); function my_custom_graph_value( $value, $field ) { if ( $field->id == 123 ) { $value = ‘new value’; } return $value; }Continue reading

Show substring of an entry

add_filter( ‘frmpro_fields_replace_shortcodes’, ‘frm_substr_shortcode’, 10, 4 ); function frm_substr_shortcode( $replace_with, $tag, $atts, $field ) { if ( isset( $atts[‘length’] ) ) { $start = isset( $atts[‘start’] ) ? $atts[‘start’] : 0; $replace_with = substr( $replace_with, $start, $atts[‘length’] ); } elseif (…Continue reading

Add a page anchor

add_filter( ‘frm_prev_page_link’, ‘change_pagination_link’, 10, 2 ); add_filter( ‘frm_first_page_link’, ‘change_pagination_link’, 10, 2 ); add_filter( ‘frm_page_link’, ‘change_pagination_link’, 10, 2 ); add_filter( ‘frm_last_page_link’, ‘change_pagination_link’, 10, 2 ); add_filter( ‘frm_next_page_link’, ‘change_pagination_link’, 10, 2 ); function change_pagination_link( $link, $atts ) { if ( $atts[‘view’]->ID ===…Continue reading

Import file from URL

add_filter(‘frm_pre_create_entry’, ‘frm_upload_from_url’); function frm_upload_from_url( $values ) { if ( $values[‘form_id’] == 5 ) { //change 5 to your form id $upload_field_id = 25; // replace 25 with the id of your upload field $url_field = 24; // replace 24 with…Continue reading

Turn off Dropzone on one page

add_filter( ‘frm_load_dropzone’, ‘stop_dropzone’ ); function stop_dropzone( $load_it ) { if ( is_page(25) ) { // set the page or other conditions here $load_it = false; } return $load_it; }Continue reading

Change View order based on URL parameter

add_filter( ‘frm_filter_view’, ‘change_my_view_object’, 10, 1); function change_my_view_object( $view ) { if ( $view->ID === 123 ) { if ( isset( $_GET[‘my_param’] ) && $_GET[‘my_param’] == ‘custom_value’ ) { $view->frm_order_by = array( 150 ); $view->frm_order = array( ‘DESC’ ); } }…Continue reading

Send separate emails for a specific action

add_filter(‘frm_send_separate_emails’, ‘frm_send_separate_emails’, 10, 2); function frm_send_separate_emails( $is_separate, $args ) { if ( in_array( $args[‘action’]->ID, array( 4933, 4924 ) ) ) { $is_separate = true; } return $is_separate; }Continue reading

Don’t validate reCaptcha during API request

add_filter( ‘frm_is_field_hidden’, ‘mark_recaptcha_hidden’, 20, 2 ); function mark_recaptcha_hidden( $hidden, $field ) { $is_api_request = defined( ‘REST_REQUEST’ ) && REST_REQUEST; if ( FrmField::is_field_type( $field, ‘captcha’ ) && $is_api_request ) { $hidden = true; } return $hidden; }Continue reading

Create an entry in another form

add_action(‘frm_after_create_entry’, ‘create_entry_after_submission’, 30, 2); function create_entry_after_submission($entry_id, $form_id){ if ( $form_id != 372 ) {//Change 372 to the ID of Form A return; } $form2 = ‘373‘;//Change 373 to the ID of Form B //Get user if (!isset($_POST[‘frm_user_id’])){ return; } $user…Continue reading