Show an avatar from email

add_filter(‘frmpro_fields_replace_shortcodes’, ‘frm_substr_shortcode’, 10, 4); function frm_substr_shortcode($replace_with, $tag, $atts, $field){ if(isset($atts[‘avatar’])){ $replace_with = get_avatar($replace_with, $atts[‘avatar’]); } return $replace_with; }Continue reading

Insert multiple values 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){ if(is_numeric($v)) $new_val .= ‘[jwplayer file=”‘. wp_get_attachment_url($v) .’”]’; } return $new_val; } return $replace_with; }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

Get value from a post ID

add_filter(‘frmpro_fields_replace_shortcodes’, ‘frm_show_post_shortcode’, 10, 4); function frm_show_post_shortcode($replace_with, $tag, $atts, $field){ if(isset($atts[‘show_post’]) and is_numeric($replace_with)){ $post = get_post($replace_with); if($post){ if(isset($post->{$atts[‘show_post’]})) $replace_with = $post->{$atts[‘show_post’]}; else $replace_with = get_post_meta($post->ID, $atts[‘show_post’], true); } } return $replace_with; }Continue reading

Link to posts with Data from Entries field

add_filter(‘frmpro_fields_replace_shortcodes’, ‘frm_dfe_link_to_post’, 10, 4); function frm_dfe_link_to_post($replace_with, $tag, $atts, $field){ if ( isset($atts[‘link’]) && $atts[‘link’] == ‘true’ && isset( $atts[‘show’] ) && $atts[‘show’] == ‘id’ ){ if ( !is_array( $replace_with ) ){ $replace_with = array( $replace_with ); } $ids = array_filter(…Continue reading

Trigger action for a specific embedded form

add_filter(‘frm_use_embedded_form_actions’, ‘frm_trigger_embedded_form_actions’, 10, 2); function frm_trigger_embedded_form_actions( $trigger_actions, $args ) { if ( $args[‘form’]->id == 123 ) { $trigger_actions = true; } return $trigger_actions; }Continue reading

Stop user ID filter for admins

add_filter(‘frm_where_filter’, ‘stop_filter_for_admin’, 10, 2); function stop_filter_for_admin( $where, $args ) { if ( $args[‘display’]->ID == 3 && $args[‘where_opt’] == 25 ) { //change 3 to the ID of your View and change 25 to the ID of your user ID field…Continue reading