PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Author name gets pulled into post content

  1. Hey,

    When user create a new post on my site, their first & last name appear automaticlly in the form fields (first & last name) which is great. the problem is the first and last name gets pulled into the post content.

    What happens is the first 2 words of the post is the first and last name of the author.
    is there a way to fix that?

    Thanks

    Posted 11 years ago on Monday March 4, 2013 | Permalink
  2. I added this to functions.php in order for the First & Last name to appear automaticlly

    // populate the field with "user_firstname" as the population parameter with the "first_name" of the current user
    add_filter('gform_field_value_user_firstname', create_function("", '$value = populate_usermeta(\'first_name\'); return $value;' ));

    // populate the field with "user_lastname" as the population parameter with the "last_name" of the current user
    add_filter('gform_field_value_user_lastname', create_function("", '$value = populate_usermeta(\'last_name\'); return $value;' ));

    // populate the field with "user_email" as the population parameter with the "email" of the current user
    add_filter('gform_field_value_user_email', create_function("", '$value = populate_usermeta(\'user_email\'); return $value;' ));

    // this function is called by both filters and returns the requested user meta of the current user
    function populate_usermeta($meta_key){
    global $current_user;
    return $current_user->__get($meta_key);
    }

    Posted 11 years ago on Monday March 4, 2013 | Permalink
  3. OK, I feel kinda stupid. I had a merge tag insert inside the post content, and that was making the problem.

    Got it all fixed now.

    Posted 11 years ago on Tuesday March 5, 2013 | Permalink
  4. Thanks for posting the update Marley.

    Posted 11 years ago on Wednesday March 6, 2013 | Permalink

This topic has been resolved and has been closed to new replies.