Use Base64 file info

add_filter( ‘frmpro_fields_replace_shortcodes’, ‘frm_get_file_info’, 10, 4 ); function frm_get_file_info( $replace_with, $tag, $atts, $field ) { if ( ! is_numeric( $replace_with ) ) { return $replace_with; } $use_base64 = isset( $atts[‘encoding’] ) && $atts[‘encoding’] === ‘base64’; $use_path_info = ! $use_base64 && isset(…Continue reading

Show last four characters

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

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

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