Change style template based on parameter

add_action( ‘formidable_shortcode_atts’, ‘maybe_change_style_class’, 10, 2 ); function maybe_change_style_class( $shortcode_atts, $atts ) { if ( isset( $atts[‘form_style’] ) ) { global $frm_atts; $frm_atts[‘switch_style’] = $atts[‘form_style’]; add_filter( ‘frm_add_form_style_class’, ‘change_style_class’, 20 ); } } function change_style_class( $class ) { global $frm_atts; if (…Continue reading

Change the currency in a single form

add_filter( ‘frm_currency’, ‘frm_custom_currency’, 10, 2 ); function frm_custom_currency( $currency, $form ) { $form_id = is_object( $form ) ? $form->id : $form; if ( $form_id == 50 ) { // Change 50 to your form ID $currency = FrmProCurrencyHelper::get_currencies( ‘AUD’ );…Continue reading

Limit the number of entries by user role

add_filter( ‘frm_validate_field_entry’, ‘limit_by_user_role’, 10, 3 ); function limit_by_user_role( $errors, $posted_field, $posted_value ) { $field_id = 136; //change 136 to the ID of the hidden field if ( $posted_field->id == $field_id ) { //get all the entries for that role $entries_for_role…Continue reading

Replace with RTL style

add_filter( ‘frm_add_form_style_class’, ‘add_style_class’, 1 ); function add_style_class( $class ) { $lang = apply_filters( ‘wpml_current_language’, null ); if ( $lang == ‘ar’ ) { // change ar to your language code remove_filter( ‘frm_add_form_style_class’, ‘FrmStylesController::get_form_style_class’, 10, 2 ); $class .= ‘frm_my_style_class frm_rtl’;…Continue reading

Add options to a signature field

<?php add_action(‘frm_field_options_form’, ‘my_field_options_form’, 10, 3); function my_field_options_form($field, $display, $values){ if ( $field[‘type’] != ‘signature’ ) { return; } if ( ! isset( $field[‘label1’] ) ) { $field[‘label1’] = ‘Draw It’; } ?> <tr> <td><label>Signature Options</label></td> <td> <label for=”label1_” class=”howto”>Draw It…Continue reading

Change the output for a field type

add_filter( ‘frmpro_fields_replace_shortcodes’, ‘display_field_value_with_shortcode’, 10, 4 ); function display_field_value_with_shortcode( $value, $tag, $atts, $field ) { if ( $field->type != ‘signature’ ) { return $value; } $value = ‘<div class=”my_custom_class”>’ . $value . ‘</div>’; return $value; }Continue reading

Set a date relative to the current date

add_filter( ‘frm_get_default_value’, ‘frm_set_relative_date’, 10, 2 ); function frm_set_relative_date( $new_value, $field ) { if ( $field ->id == 4615 ) { //change 4615 to the ID of the field $start = strtotime( ‘today’ );//change ‘today’ to any set or relative date…Continue reading

Copy multiple field values

add_filter(‘frm_setup_edit_fields_vars’, ‘frm_copy_multiple_field_values_before_edit’, 20, 3); function frm_copy_multiple_field_values_before_edit( $values, $field, $entry_id ) { if ( FrmAppHelper::is_admin() ) { //don’t copy the field value if the entry is edited in the admin area return $values; } $field_pairs = array( //for each pair of…Continue reading