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

Add a case-sensitive like comparison

add_filter(‘frmpro_fields_replace_shortcodes’, ‘frm_check_for_case_sensitive_like_value’, 20, 4); function frm_check_for_case_sensitive_like_value( $replace_with, $tag, $atts, $field ){ if ( isset( $atts[‘case_sensitive_like’] ) && ! empty( $replace_with ) ) { if ( is_array( $replace_with ) ) { if ( ! in_array( $atts[‘case_sensitive_like’], $replace_with ) ) { $replace_with…Continue reading

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

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