<?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: Setting GF-form submitted posts to password protected?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/setting-gf-form-submitted-posts-to-password-protected</link>
		<description>Gravity Support Forums Topic: Setting GF-form submitted posts to password protected?</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 06:52:01 +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/setting-gf-form-submitted-posts-to-password-protected" rel="self" type="application/rss+xml" />

		<item>
			<title>RichardBest on "Setting GF-form submitted posts to password protected?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/setting-gf-form-submitted-posts-to-password-protected#post-15735</link>
			<pubDate>Sun, 09 Jan 2011 15:42:05 +0000</pubDate>
			<dc:creator>RichardBest</dc:creator>
			<guid isPermaLink="false">15735@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;That's perfect. Thanks so much David and Alex. &#60;/p&#62;
&#60;p&#62;Just one final question please if I may: If I wanted to do the same thing for a number of forms on the same site, would it be OK to replicate the code a number of times, but adding the different form IDs and password field IDs, or would it be necessary to modify the code (into an array perhaps)?&#60;/p&#62;
&#60;p&#62;Thanks again&#60;br /&#62;
Richard
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Setting GF-form submitted posts to password protected?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/setting-gf-form-submitted-posts-to-password-protected#post-15696</link>
			<pubDate>Sun, 09 Jan 2011 09:33:00 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">15696@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Haha, this just doesn't like us does it? I spoke with Alex about this and he made a few recommendations. Here is the updated code:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastie.org/1442490&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/1442490&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;This has already been implemented on your dev site, so you won't need to add it again, just wanted to post it here for posterity.&#60;/p&#62;
&#60;p&#62;For anyone else reading this thread, keep in mind that the &#34;invoice&#34; variable returned by the IPN in the $_POST will not always be the same as the entry ID for which the payment is being made. Instead, you will need to use the &#34;custom&#34; variable in the $_POST ($_POST['custom']) which can be used to not only retrieve the entry ID, but also to test the validity of &#34;custom&#34; variable demonstrated in the code sample above.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>RichardBest on "Setting GF-form submitted posts to password protected?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/setting-gf-form-submitted-posts-to-password-protected#post-15694</link>
			<pubDate>Sun, 09 Jan 2011 00:46:59 +0000</pubDate>
			<dc:creator>RichardBest</dc:creator>
			<guid isPermaLink="false">15694@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Many thanks David. Much appreciated. I've tried the revised code but cannot get it working. Presumably I change the number in &#34;gform_post_data_4&#34; to the ID of my form (i.e., 1) and the number in &#34;$post_data['post_password'] = $entry['6']&#34; to the ID no. of the field into which the password is being entered (i.e., 63). I've tried this but the posts are still not being set as password protected. The full code I'm using in my relevant functions file is:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_post_data_1&#38;quot;, &#38;quot;set_post_password&#38;quot;);
function set_post_password($post_data){

    $entry = RGFormsModel::get_lead($_POST[&#38;quot;invoice&#38;quot;]);

    $post_data[&#38;quot;post_password&#38;quot;] = $entry[&#38;quot;63&#38;quot;];

    return $post_data;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;(As you can see, I tried double as opposed to single quotes to see if that made any difference; as expected, it didn't.)&#60;/p&#62;
&#60;p&#62;Sorry to keep bothering you with this. I much appreciate your help.&#60;/p&#62;
&#60;p&#62;Best&#60;br /&#62;
Richard
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Setting GF-form submitted posts to password protected?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/setting-gf-form-submitted-posts-to-password-protected#post-15692</link>
			<pubDate>Sat, 08 Jan 2011 21:59:21 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">15692@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Richard,&#60;/p&#62;
&#60;p&#62;The issue did reside in the fact you were using the delay post creation PayPal functionality. Here is an updated script that should do the trick:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastie.org/1441553&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/1441553&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The issue is that the values of the &#60;strong&#62;$_POST&#60;/strong&#62; array are different when the &#60;strong&#62;gform_post_data&#60;/strong&#62; hook is run without the delay vs with the delay. Instead of having all of the entry data available in the the $_POST, we have to use the invoice ID (only available in the $_POST when a PayPal payment is being processed) to get the entry data.&#60;/p&#62;
&#60;p&#62;Let me know if you have any issues with this.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Setting GF-form submitted posts to password protected?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/setting-gf-form-submitted-posts-to-password-protected#post-15686</link>
			<pubDate>Sat, 08 Jan 2011 15:47:39 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">15686@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;That would be helpful Richard: &#60;a href=&#34;mailto:david@rocketgenius.com&#34;&#62;david@rocketgenius.com&#60;/a&#62;. Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>RichardBest on "Setting GF-form submitted posts to password protected?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/setting-gf-form-submitted-posts-to-password-protected#post-15683</link>
			<pubDate>Sat, 08 Jan 2011 15:36:32 +0000</pubDate>
			<dc:creator>RichardBest</dc:creator>
			<guid isPermaLink="false">15683@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi David&#60;/p&#62;
&#60;p&#62;The problem I'm having is that the posts aren't being password protected at all. &#60;/p&#62;
&#60;p&#62;I wonder whether this might have something to do with the fact that I'm running the Paypal Add-On in conjunction with the form?&#60;/p&#62;
&#60;p&#62;I presume also that it doesn't make any difference whether the form is set, in the post field settings, to go to draft, pending review or published?&#60;/p&#62;
&#60;p&#62;I can send you a login to the testing site I'm testing this on if that would help.&#60;/p&#62;
&#60;p&#62;Many thanks&#60;br /&#62;
Richard
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Setting GF-form submitted posts to password protected?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/setting-gf-form-submitted-posts-to-password-protected#post-15680</link>
			<pubDate>Sat, 08 Jan 2011 11:17:08 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">15680@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Okie dokie. Did some more testing and the snippet I shared with you definitely works; however... WordPress handles post passwords in an odd way that may be causing some confusion.&#60;/p&#62;
&#60;p&#62;When a user enters a password for a post, it stores that password as a PHP cookie. The problem is, it uses that same cookie for all other password protected posts on the site as well. This means that if more than one post have the same password, any user who enters the password for one will have access to view all posts with that same password without being prompted to reenter the password.&#60;/p&#62;
&#60;p&#62;Is this what you are experiencing or are your posts not being password protected at all?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>RichardBest on "Setting GF-form submitted posts to password protected?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/setting-gf-form-submitted-posts-to-password-protected#post-15667</link>
			<pubDate>Sat, 08 Jan 2011 00:36:53 +0000</pubDate>
			<dc:creator>RichardBest</dc:creator>
			<guid isPermaLink="false">15667@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks again for this David. I'm not sure, though, that this code has the effect of designating that all posts submitted through the specified form are to be treated as password-protected posts. It's not doing that for me with my testing. I'd be grateful for any further thoughts please. Is it also possible, for example, to set post_status for all posts submitted through a form to password protected?&#60;/p&#62;
&#60;p&#62;Many thanks.&#60;br /&#62;
Richard
&#60;/p&#62;</description>
		</item>
		<item>
			<title>RichardBest on "Setting GF-form submitted posts to password protected?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/setting-gf-form-submitted-posts-to-password-protected#post-15658</link>
			<pubDate>Fri, 07 Jan 2011 17:46:45 +0000</pubDate>
			<dc:creator>RichardBest</dc:creator>
			<guid isPermaLink="false">15658@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Absolutely superb. Thanks so much David. I'm so impressed with the GF crew, that I'm off to Tweet! @richard_best
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Setting GF-form submitted posts to password protected?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/setting-gf-form-submitted-posts-to-password-protected#post-15657</link>
			<pubDate>Fri, 07 Jan 2011 17:26:45 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">15657@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;&#60;a href=&#34;http://pastie.org/1438417&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/1438417&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Just replace the &#60;strong&#62;1&#60;/strong&#62; after &#34;gform_post_data_&#34; with the ID of your form and the &#60;strong&#62;3&#60;/strong&#62; in &#34;$_POST['input_3'] with the field ID of your password field.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
