<?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: How to get entry ID from current user?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/how-to-get-entry-id-from-current-user-after-submitting-form</link>
		<description>Gravity Support Forums Topic: How to get entry ID from current user?</description>
		<language>en-US</language>
		<pubDate>Fri, 17 Apr 2026 13:20:29 +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/how-to-get-entry-id-from-current-user-after-submitting-form" rel="self" type="application/rss+xml" />

		<item>
			<title>Tobe on "How to get entry ID from current user?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-get-entry-id-from-current-user-after-submitting-form#post-217183</link>
			<pubDate>Sat, 20 Apr 2013 14:07:11 +0000</pubDate>
			<dc:creator>Tobe</dc:creator>
			<guid isPermaLink="false">217183@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This is what I got so far.&#60;/p&#62;
&#60;p&#62;Function to make form-ID=2 to create a page instead of post (thanks to Chris):&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_post_data&#38;quot;, &#38;quot;change_post_type&#38;quot;, 10, 2);
function change_post_type($post_data, $form){
    //only change post type on form id 1
    if($form[&#38;quot;id&#38;quot;] != 2)
       return $post_data;

    $post_data[&#38;quot;post_type&#38;quot;] = &#38;quot;page&#38;quot;;
    return $post_data;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Code in my page.php to determine what to display depending if user is signed in (or not) and if user do have a page created or not:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php if ( is_user_logged_in() ) { ?&#38;gt;

&#38;lt;?php global $wpdb;
$user = wp_get_current_user();
$where = get_posts_by_author_sql( &#38;#39;page&#38;#39;, true, $user-&#38;gt;ID );
$count = $wpdb-&#38;gt;get_var( &#38;quot;SELECT COUNT(*) FROM $wpdb-&#38;gt;posts $where&#38;quot; );

if ( $count &#38;gt;= 1 ) { ?&#38;gt;
// This is what user see if form is submitted, where &#38;#39;{entry-ID}&#38;#39; should be replaced by the user&#38;#39;s entry iD
&#38;lt;h2&#38;gt;Hey &#38;lt;?php echo $current_user-&#38;gt;display_name ?&#38;gt;, thank you for submitting the form. Visit your page here: &#60;a href=&#34;http://www.example.com/&#34; rel=&#34;nofollow&#34;&#62;http://www.example.com/&#60;/a&#62;{entry-ID}&#38;lt;/h2&#38;gt;

&#38;lt;?php } else { ?&#38;gt;
// If user have not submitted a form, user is shown the info below with the form to submit
&#38;lt;h2&#38;gt;Hey &#38;lt;?php echo $current_user-&#38;gt;display_name ?&#38;gt;, Thank you for joining. To create a page please submit the form below:&#38;lt;/h2&#38;gt;&#38;lt;?php echo do_shortcode(&#38;#39;[gravityform id=&#38;quot;2&#38;quot; name=&#38;quot;Join the movement of Gooders&#38;quot; title=&#38;quot;false&#38;quot; description=&#38;quot;false&#38;quot;]&#38;#39;); ?&#38;gt;

&#38;lt;?php } } else { ?&#38;gt;
// if user is not logged in, user is urged to log in to submit form
&#38;lt;h2&#38;gt;&#38;lt;Please log in to create a page &#38;lt;?php do_action( &#38;#39;wordpress_social_login&#38;#39; ); ?&#38;gt;&#38;lt;/h2&#38;gt;

&#38;lt;?php } ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Question that is left now:&#60;br /&#62;
What code/function should I use to display the user's entry ID (on form 2) into the url on the second option like: &#60;a href=&#34;http://www.example.com/&#34; rel=&#34;nofollow&#34;&#62;http://www.example.com/&#60;/a&#62;{entry-ID} ??
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Tobe on "How to get entry ID from current user?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-get-entry-id-from-current-user-after-submitting-form#post-214425</link>
			<pubDate>Thu, 18 Apr 2013 10:52:05 +0000</pubDate>
			<dc:creator>Tobe</dc:creator>
			<guid isPermaLink="false">214425@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I tried a lot using the is_user_logged_in function, but that only gives a blank screen.....(no error, no styling, just blank screen on all pages) But if I find a solution for that, how do I make my website check the e-mail address of that user and compare it with all the form entries to find a match, and then get the info from thet form entry to use in a text maybe using merge tags?&#60;/p&#62;
&#60;p&#62;Or is it impossible to display some of the user's entries of a form with some additional text instead of the form itself once the user have submitted the form?&#60;br /&#62;
(Or maybe to create a shortcode for that?)&#60;/p&#62;
&#60;p&#62;Who is keen enough to find a solution?&#60;br /&#62;
I would appreciate your input a lot ;-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Tobe on "How to get entry ID from current user?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-get-entry-id-from-current-user-after-submitting-form#post-212499</link>
			<pubDate>Wed, 17 Apr 2013 05:26:45 +0000</pubDate>
			<dc:creator>Tobe</dc:creator>
			<guid isPermaLink="false">212499@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have a form for users only, and made sure users can only submit the form only once.&#60;br /&#62;
Once the form is submitted, a page is created using the entry ID as part of the title and url.&#60;/p&#62;
&#60;p&#62;How can I :&#60;br /&#62;
1- Auto check if the user have already submitted the form, and if so;&#60;br /&#62;
2- Hide the form and instead get the user's entry ID and add that to a url ( example.com/number-{entry-id} ) or else;&#60;br /&#62;
3- Display the form.&#60;/p&#62;
&#60;p&#62;Thanks in advance!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
