<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Assigning a submission to an author that already exists.</title>
		<link>https://legacy.forums.gravityhelp.com/topic/assigning-a-submission-to-an-author-that-already-exists</link>
		<description>Gravity Support Forums Topic: Assigning a submission to an author that already exists.</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 09:08:23 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/assigning-a-submission-to-an-author-that-already-exists" rel="self" type="application/rss+xml" />

		<item>
			<title>David Peralty on "Assigning a submission to an author that already exists."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/assigning-a-submission-to-an-author-that-already-exists#post-68092</link>
			<pubDate>Thu, 26 Jul 2012 15:46:36 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">68092@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Let us know if any other issues come up.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>astronauts on "Assigning a submission to an author that already exists."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/assigning-a-submission-to-an-author-that-already-exists#post-68058</link>
			<pubDate>Thu, 26 Jul 2012 10:22:09 +0000</pubDate>
			<dc:creator>astronauts</dc:creator>
			<guid isPermaLink="false">68058@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Apparently I missed the email that notified me of your reply - but that's great, thanks! I'll try to make it work. Many thanks!&#60;/p&#62;
&#60;p&#62;Best,&#60;br /&#62;
-Pim
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Assigning a submission to an author that already exists."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/assigning-a-submission-to-an-author-that-already-exists#post-67109</link>
			<pubDate>Thu, 19 Jul 2012 15:59:40 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">67109@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Astronauts,&#60;/p&#62;
&#60;p&#62;You can use the &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_after_submission&#34; rel=&#34;nofollow&#34;&#62;gform_after_submission&#60;/a&#62; hook to fire some functionality after the entry has been completely submitted and post created. You can then use the &#60;a href=&#34;http://codex.wordpress.org/Function_Reference/get_user_by&#34; rel=&#34;nofollow&#34;&#62;get_user_by()&#60;/a&#62; to pass the submitted email. If it returns a valid user, you can then assign that user ID to as the post author via the &#60;a href=&#34;http://codex.wordpress.org/Function_Reference/wp_update_post&#34; rel=&#34;nofollow&#34;&#62;wp_update_post()&#60;/a&#62; function.&#60;/p&#62;
&#60;p&#62;Some psuedo code to get you started:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
// update &#38;quot;1&#38;quot; to your form ID
add_action(&#38;#39;gform_after_submission_1&#38;#39;, &#38;#39;maybe_attribute_author&#38;#39;);
function maybe_attribute_author($entry) {

    $author = get_user_by(&#38;quot;email&#38;quot;, $entry[&#38;#39;3&#38;#39;]); // update the &#38;quot;3&#38;quot; to the ID of your form&#38;#39;s email field
    if(!$author)
        return;

    $post = array();
    $post[&#38;#39;ID&#38;#39;] = $entry[&#38;#39;post_id&#38;#39;];
    $post[&#38;#39;post_author&#38;#39;] = $author-&#38;gt;ID;
    wp_update_post($post);

}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>astronauts on "Assigning a submission to an author that already exists."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/assigning-a-submission-to-an-author-that-already-exists#post-66614</link>
			<pubDate>Tue, 17 Jul 2012 02:31:37 +0000</pubDate>
			<dc:creator>astronauts</dc:creator>
			<guid isPermaLink="false">66614@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for your response! &#60;/p&#62;
&#60;p&#62;Yes, that is correct. &#60;/p&#62;
&#60;p&#62;- Users fill out a front-end form that is captured as a post&#60;br /&#62;
- Users that have filled-out the form before aren't registered anymore as they already exist in the DB&#60;br /&#62;
- For those users, I want to grab the filled-out email@&#60;br /&#62;
- Set the author of that submitted post to match that email@ or any other way to overwrite the standard author and set to the user that submitted the post.&#60;/p&#62;
&#60;p&#62;Does that clarify things? Hope so.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Assigning a submission to an author that already exists."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/assigning-a-submission-to-an-author-that-already-exists#post-66556</link>
			<pubDate>Mon, 16 Jul 2012 18:50:01 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">66556@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;To be clear, you are registering the user based on their submitted email on their initial submission and assigning the created post to that user via the User Registration add-on. Now you'd like to take this a step further and on subsequent submissions, the created post should be assigned to the existing user based on the re-submitted email address. &#60;/p&#62;
&#60;p&#62;Is this correct?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>astronauts on "Assigning a submission to an author that already exists."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/assigning-a-submission-to-an-author-that-already-exists#post-66266</link>
			<pubDate>Sat, 14 Jul 2012 16:27:01 +0000</pubDate>
			<dc:creator>astronauts</dc:creator>
			<guid isPermaLink="false">66266@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;L.S.,&#60;/p&#62;
&#60;p&#62;I have a problem with assigning users to a post captured via a Gravity form. The glitch is I want this to work for users that have already submitted a post and are registered at the first submit. I DO NOT want them to login. &#60;/p&#62;
&#60;p&#62;Some background:&#60;br /&#62;
I'm building an internal corporate platform meant for capturing posts. To capture the posts, I'm using Gravity + UserReg add-on. I want to keep the threshold for submitting a post as low as possible, so I'm simply using a form that allows user to add a post without the hassle of registering. This is done automatically via the form without them ever knowing or receiving a password. Even more, I don't want my users to ever see -let alone login to- the WP backend.&#60;/p&#62;
&#60;p&#62;The glitch is users can add multiple posts. There's basically two entry conditions:&#60;br /&#62;
(1) A user has never submitted an post before. Based on a condition (&#34;have you submitted a post before? &#38;gt; no&#34;) the user form is set to register the user.&#60;br /&#62;
(2) The user submitted a post before. Based on the same condition, the user registration is skipped. &#60;/p&#62;
&#60;p&#62;The problem here is that in the second condition the post/post isn't assigned to the user. This is absolutely essential for the platform to work. When I remove the condition, users simply get an error message when they submit a second post because they've already been registered at the first submit (which they won't understand). &#60;/p&#62;
&#60;p&#62;Is it possible to assign a post to an existing user with Gravity (based on matching e-mails)? I haven't found the option. I've tried to write a plugin that uses WP's set_as_author() (take the user email, assign the post to this user), but I'm simply not skilled enough to make this work.&#60;/p&#62;
&#60;p&#62;Therefore:&#60;br /&#62;
(1) Am I missing something and IS it possible to assign a post to a user that already exists with Gravity in a form (based on matching emailadress provided) OR is there another way to accomplish this with Gravity?&#60;br /&#62;
(2) Is this a planned development?&#60;/p&#62;
&#60;p&#62;Hope you can help!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
