<?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: Block Form Access Based on Advanced User Authentication</title>
		<link>https://legacy.forums.gravityhelp.com/topic/block-form-access-based-on-advanced-user-authentication</link>
		<description>Gravity Support Forums Topic: Block Form Access Based on Advanced User Authentication</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 04:52:49 +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/block-form-access-based-on-advanced-user-authentication" rel="self" type="application/rss+xml" />

		<item>
			<title>devEdge on "Block Form Access Based on Advanced User Authentication"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/block-form-access-based-on-advanced-user-authentication#post-362041</link>
			<pubDate>Thu, 04 Jul 2013 19:15:21 +0000</pubDate>
			<dc:creator>devEdge</dc:creator>
			<guid isPermaLink="false">362041@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Ok, I guess I asked the question too quickly. I was right about using the gform_pre_render filter. Here's basically what I did...&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter( &#38;quot;gform_pre_render&#38;quot;, &#38;quot;block_user_render_form&#38;quot;, 100, 1 );
function block_user_render_form( $form ) {
//Put your form ID instead of 6
if ( $form[&#38;#39;id&#38;#39;] != 6 ) {
    return $form;
}
//test for authorization
if ( !$authorized ) {
   echo &#38;quot;&#38;lt;p&#38;gt;You are not authorized to do this.&#38;lt;/p&#38;gt;&#38;quot;;
   return null;
}
return $form;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The only caveat to returning a null form, is that GF will also output the following after the unauthorized message:&#60;br /&#62;
&#34;Oops! We could not locate your form.&#34;&#60;/p&#62;
&#60;p&#62;Which didn't bother me. But might for some...'&#60;/p&#62;
&#60;p&#62;Cheers!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>devEdge on "Block Form Access Based on Advanced User Authentication"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/block-form-access-based-on-advanced-user-authentication#post-361993</link>
			<pubDate>Thu, 04 Jul 2013 17:55:18 +0000</pubDate>
			<dc:creator>devEdge</dc:creator>
			<guid isPermaLink="false">361993@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I have a business directory website that allows a user to edit their business listing details (partially, at least). Each business listing (a custom post) is assigned the user as author. I use GF basically as a frontend editor, pulling in the post field values on the edit post form. Then, I've locked all these users out of the WordPress admin area. It's pretty cool actually...&#60;/p&#62;
&#60;p&#62;Here's the problem though. GF, by default, is only capable of creating new posts - not editing existing posts. Thus, when the edit form is called with an invalid post to edit (or none at all), GF defaults to creating a new post rather than displaying an unauthorized message. I need to change that.&#60;/p&#62;
&#60;p&#62;Is there a hook or filter I can use to add my own authentication logic and block the form when it is called? I was thinking the gform_pre_render filter might do the trick. Can I do my permissions check there and unset the form or something? Then echo an unauthorized message instead? How can I block the form from displaying (rendering at all actually)?&#60;/p&#62;
&#60;p&#62;By the way... GF does not respect the publish_posts capability in WordPress.&#60;/p&#62;
&#60;p&#62;Any thoughts?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
