Allow the [gallery] shortcode

add_filter( ‘frm_sanitize_shortcodes’, ‘maybe_allow_user_shortcodes’, 10, 2 ); function maybe_allow_user_shortcodes( $sanitize, $atts ) { if ( strpos( $atts[‘value’], ‘[gallery’ ) !== false ) { $sanitize = false; } return $sanitize; }Continue reading

Add extra content to lookup options

add_filter( ‘frm_filtered_lookup_options’, ‘change_lookup_options’, 10, 2 ); function change_lookup_options( $options, $args ) { if ( $args[‘field’]->id == 25 ) { // change 25 to the id of the field in the other form foreach ( $options as $k => $option )…Continue reading

Hide variation price

add_filter( ‘wc_fp_addons_format_cart_item_price’, ‘remove_variation_price’ ); function remove_variation_price( $value ) { $formatted = ”; return $formatted; }Continue reading

Add text styling to pie graph

add_filter(‘frm_google_chart’, ‘frm_pie_chart_styling’, 10, 2); function frm_pie_chart_styling($options, $atts){ if ( $atts[‘type’] == ‘pie’ ) { $options[‘pieSliceTextStyle’] = array(‘color’ => ‘red’); } return $options; }Continue reading

Validate password field

add_filter(‘frm_validate_field_entry’, ‘check_user_pass’, 10, 3); function check_user_pass($errors, $posted_field, $posted_value){ if($posted_field->id == 6369){ //change 6369 to the ID of the password field to validate if(!preg_match(‘/^(?=.*[A-Za-z])(?=.*d)[A-Za-z!@#$%&*()?d]{8,}$/’, $posted_value)) { $errors[‘field’. $posted_field->id] = ‘Password must be at least 8 characters long and contain at least…Continue reading

Combine auto increment field with another field

add_filter(‘frm_validate_field_entry’, ‘combine_auto_id_with_field’, 15, 3); function combine_auto_id_with_field( $errors, $posted_field, $posted_value ) { if($posted_field->id == 56){ //change 56 to the ID of the destination field $_POST[‘item_meta’][56] = $_POST[‘item_meta’][54] . $_POST[‘item_meta’][55]; //change 54 and 55 to the IDs of the auto increment field…Continue reading

Calculate time between dates + times

add_filter(‘frm_validate_field_entry’, ‘calculate_time’, 11, 3); function calculate_time($errors, $field, $value){ if($field->id == 30){ //change 30 to the ID of the hidden or admin only field which will hold the calculation $start_date = date_create_from_format( ‘m/d/Y’, $_POST[‘item_meta’][23] ); // Change 23 to the ID…Continue reading