Display percentage in pie graph

add_filter(‘frm_google_chart’, ‘frm_pie_chart_tooltip_percentage’, 10, 2); function frm_pie_chart_tooltip_percentage($options, $atts){ if ( $atts[‘type’] == ‘pie’ ) { $options[‘tooltip’] = array(‘text’ => ‘percentage’); } return $options; }Continue reading

Disable file URLs for uploaded file

add_action( ‘frm_field_input_html’, ‘disable_dropzone_urls’ ); function disable_dropzone_urls( $field ) { $field_id = 4626; // change 4626 to your field ID if ( $field_id !== (int) $field[‘id’] ) { return; } global $frm_vars; $key = ‘file’ . $field_id; if ( ! array_key_exists(…Continue reading

Remove icon and instruction

add_filter( ‘frm_filter_final_form’, ‘remove_conversational_html’, 15 ); function remove_conversational_html( $html ) { // Remove enter icons $html = preg_replace( ‘/<svg(.*?)d=”M15.3 6c0 .7-.3 1.2-.7 1.7a2.2 2.2 0 0 1-1.7.7H7.4v2.3L.6 7.5l6.8-3.2v2.3H12c.3 0 .6-.1.8-.3.3-.2.4-.5.4-.8V.7h2V6Z”(.*?)\/><\/svg>/’, ”, $html, 2 ); // Remove the “Shift+Tab” instruction $html =…Continue reading

Wrap the value of checkbox field in a span

add_filter( ‘frm_entries_column_value’, ‘wrap_column_value_in_span’ ); function wrap_column_value_in_span( $val, $args ) { $field = FrmField::getOne( $args[‘col_name’] ); if ( ! $field ) { return $val; // Field does not exist or this is a specific column. } if ( ‘checkbox’ === $field->type…Continue reading

Replace [date] or [user_id] before sending an API request

add_action( ‘frm_trigger_api_action’, ‘add_shortcodes_to_api_request’, 1 ); function add_shortcodes_to_api_request() { add_filter( ‘frm_content’, function( $value ) { $value = str_replace( ‘[date]’, FrmProAppHelper::get_date( ‘Y-m-d’ ), $value ); $value = str_replace( ‘[user_id]’, get_current_user_id(), $value ); return $value; } ); }Continue reading

Add custom class to a form

add_filter( ‘frm_add_form_style_class’, ‘add_style_class’, 10, 3 ); function add_style_class( $class, $style, $args = array() ) { $target_form_id = 439; // change 439 to your form ID. if ( ! empty( $args[‘form’] ) && ! empty( $args[‘form’][‘fields’] ) ) { $field =…Continue reading

Check if a user exists or not

add_filter(‘frm_filter_view’, ‘check_if_users_exists’, 10, 2); function check_if_users_exists( $view ) { $target_view_id = 380; // change this to your View ID. if ( $target_view_id !== (int) $view->ID ) { return $view; } $target_form_id = $view->frm_form_id; global $wpdb; $item_ids = FrmDb::get_col( $wpdb->prefix .…Continue reading

Set quiz field as correct

add_filter( ‘frm_quiz_is_correct’, ‘is_quiz_correct’, 10, 2 ); function is_quiz_correct( $is_correct, $args ) { $target_field_id = 1246; // Change 1246 with your field ID if ( $target_field_id === (int) $args[‘field’]->id ) { $is_correct = true; } return $is_correct; }Continue reading