Pull in Email Field into Fluent Forms (FREE)

Description/Instructions

This snippet will allow you to pull in an email from an email field in the custom post type fields to send the contact form to that email instead of an author email. 

If this snippet helped, feel free to buy me a taco :)

/*
* Use default value in the editor as
* {embed_post_custom_field}
* Then it will show the embedded post's custom field value
*/
add_filter('fluentform_editor_shortcode_callback_embed_post_custom_field', function ($code) {
$post_id = get_the_ID(); // Get the current post ID
$custom_field_value = get_post_meta($post_id, 'email', true); // Replace 'your_custom_field_key' with your actual custom field key
return $custom_field_value;
});

  • PHP
Copy Code

Let's Chat About this Snippet