Check if value is not equal to several values

add_filter(‘frmpro_fields_replace_shortcodes’, ‘frm_not_equal_to_multiple_values’, 10, 4); function frm_not_equal_to_multiple_values( $replace_with, $tag, $atts, $field ) { if ( isset ( $atts[‘not_equal_multiple’] ) ) { $check_values = explode( ‘,’, $atts[‘not_equal_multiple’] ); foreach ( $check_values as $check_value ) { if ( $replace_with == $check_value ) {…Continue reading

Create a weekly recurring event

add_filter(‘frm_show_entry_dates’, ‘weekly_recurring_event’, 10, 2); function weekly_recurring_event($dates, $entry){ if ( $entry->form_id == 5 ){ //change 5 to the ID of your form if ( isset($entry->metas[125]) && $entry->metas[125] == ‘Yes’ ) {//Change 125 to the ID of your “Recurs weekly” field $start_date…Continue reading

Use typed signature

add_filter(‘frm_graph_value’, ‘my_custom_graph_value’, 10, 2); function my_custom_graph_value( $value, $field ) { if ( is_object( $field ) && $field->type == ‘signature’ ) { if ( is_array( $value ) ) { if ( ( ! isset( $value[‘output’] ) || empty( $value[‘output’] ) )…Continue reading

Check each value from checkbox

add_filter(‘frm_filter_where_val’, ‘frm_search_multiple_values’, 8, 2); function frm_search_multiple_values($where, $args){ if ( $args[‘display’]->ID == 205 and in_array( $args[‘where_opt’], array( 82, 83, 84 ) ) ) { $where = explode(‘, ‘, $where); } return $where; }Continue reading

Set a custom filter value

add_filter(‘frm_filter_where_val’, ‘my_custom_filter_value’, 8, 2); function my_custom_filter_value( $where, $args ) { if ( $args[‘display’]->ID == 205 && $args[‘where_opt’] == 84 && isset( $_GET[‘param_name’] ) && $_GET[‘param_name’] ) { $where = $_GET[‘param_name’]; } return $where; }Continue reading

Remove characters from filter value

add_filter(‘frm_filter_where_val’, ‘remove_characters_from_filter_value’, 8, 2); function remove_characters_from_filter_value( $where_value, $args ) { if ( $args[‘display’]->ID == 205 && $args[‘where_opt’] == 84 ) { $where_value = str_replace( array( ‘amp;’ ), ”, $where_value ); } return $where_value; }Continue reading

Search linked field for numeric values

add_filter(‘frm_search_for_dynamic_text’, ‘search_numeric_values_in_dynamic_field’, 10, 3); function search_numeric_values_in_dynamic_field( $search_linked_values, $where_field, $args ) { if ( $where_field->id == 100 ) { //change 100 to the ID of your field $search_linked_values = true; } return $search_linked_values; }Continue reading

Link thumbnail to full size images with multiple uploads

add_filter(‘frmpro_fields_replace_shortcodes’, ‘frm_make_shortcode’, 10, 4); function frm_make_shortcode($replace_with, $tag, $atts, $field){ if(isset($atts[‘link_full’])){ $new_val = ”; foreach((array)$replace_with as $v){ if(is_numeric($v)){ $full = wp_get_attachment_image_src($v, ‘full’); $thumb = wp_get_attachment_image_src($v); $new_val .= ‘<a href=”‘. $full[0] .’”><img src=”‘ . $thumb[0] . ‘” /></a>’; } } return $new_val;…Continue reading

Only show first file from a multiple-image upload

add_filter(‘frmpro_fields_replace_shortcodes’, ‘frm_show_first’, 10, 4); function frm_show_first($replace_with, $tag, $atts, $field){ if(isset($atts[‘show_first’])){ extract( shortcode_atts(array( ‘show_first’ => ‘0’, ), $atts ) ); $replace_with = array_filter((array)$replace_with); $new_val = array_slice($replace_with, 0, $show_first); return $new_val; } return $replace_with; }Continue reading

Insert a link for each field option into a shortcode

add_filter(‘frmpro_fields_replace_shortcodes’, ‘frm_make_shortcode’, 10, 4); function frm_make_shortcode($replace_with, $tag, $atts, $field){ if(isset($atts[‘shortcode’])){ $new_val = ”; foreach((array)$replace_with as $v){ $new_val .= ‘<a href=”testing.com/?paramname=’.$v.’”>’ . $v . ‘</a>, ‘; //modify testing.com and paramname to whatever you would like. } return $new_val; } return $replace_with;…Continue reading