I can populate post author email with this code:
add_filter('gform_field_value_author_email', 'populate_post_author_email');
function populate_post_author_email($value){
global $post;
$author_email = get_the_author_meta('email', $post->post_author);
return $author_email;
}
It’s ok, but how i can populate meta of post? meta = imail
I’m trying with
add_filter('gform_field_value_meta_imail', 'populate_post_meta_imail');
function populate_post_meta_imail($value){
global $post;
$meta_imail = get_post_meta('imail', $post->post_id);
return $meta_imail;
}
You have the arguments for
get_post_meta
backwards. You have:Whereas, where you to check the Codex, it should be:
Or is your case:
That is assuming that
$post
is set correctly and that you are using the Gravity Forms hooks correctly.