<?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: submitting 2 forms as 2 custom post types</title>
		<link>https://legacy.forums.gravityhelp.com/topic/submitting-2-forms-as-2-custom-post-types</link>
		<description>Gravity Support Forums Topic: submitting 2 forms as 2 custom post types</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 23:35:11 +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/submitting-2-forms-as-2-custom-post-types" rel="self" type="application/rss+xml" />

		<item>
			<title>Alex Cancado on "submitting 2 forms as 2 custom post types"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/submitting-2-forms-as-2-custom-post-types#post-8395</link>
			<pubDate>Tue, 10 Aug 2010 15:53:50 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">8395@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;404 errors are usually associated with issues with your permalink. It is very strange that you only get the 404 when you have a form in your post.&#60;br /&#62;
I don't know what could be causing your issue, but if you would like me to try to debug it, please email (alex[at]rocketgenius.com) me an FTP and WP admin login and I will try to find out what is causing this.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sdever on "submitting 2 forms as 2 custom post types"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/submitting-2-forms-as-2-custom-post-types#post-8371</link>
			<pubDate>Tue, 10 Aug 2010 01:43:43 +0000</pubDate>
			<dc:creator>sdever</dc:creator>
			<guid isPermaLink="false">8371@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Okay, as I reread my post, I spotted the problem and used the code below, which works.&#60;/p&#62;
&#60;p&#62;But now I am encountering something very bizarre.  I want to save this form on a child page of parent (top-level) page Events.  &#60;/p&#62;
&#60;p&#62;When I do this, then click on &#34;view page&#34; , I get the 404 Not found message, even though I am clicking from inside the saved post.  This happens regardless of what I name the page or the slug.&#60;/p&#62;
&#60;p&#62;When I remove the form, I can view it fine.&#60;br /&#62;
When I save the page (with form) under any other parent page, I can view it fine.&#60;/p&#62;
&#60;p&#62;The problem only happens when I save it with the form, under the parent page Events.&#60;/p&#62;
&#60;p&#62;Do you have any idea why this is happening?  I can find a workaround, but just curious if there's an answer...&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter( &#38;quot;gform_post_data&#38;quot;, &#38;quot;update_post_type&#38;quot;, 10, 2 );
function update_post_type( $post_data, $form ) {
	if( $form[&#38;quot;id&#38;quot;] == &#38;#39;1&#38;#39; ) {
		$post_data[&#38;quot;post_type&#38;quot;] = &#38;quot;pv_listing&#38;quot;;
	}
	elseif( $form[&#38;quot;id&#38;quot;] == &#38;#39;2&#38;#39; ) {
		$post_data[&#38;quot;post_type&#38;quot;] = &#38;quot;pv_event&#38;quot;;
	}
	return $post_data;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>sdever on "submitting 2 forms as 2 custom post types"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/submitting-2-forms-as-2-custom-post-types#post-8370</link>
			<pubDate>Tue, 10 Aug 2010 01:11:59 +0000</pubDate>
			<dc:creator>sdever</dc:creator>
			<guid isPermaLink="false">8370@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Sorry, pv_events was a typo in my email -- the spelling in the code is correct
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sdever on "submitting 2 forms as 2 custom post types"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/submitting-2-forms-as-2-custom-post-types#post-8369</link>
			<pubDate>Tue, 10 Aug 2010 01:10:44 +0000</pubDate>
			<dc:creator>sdever</dc:creator>
			<guid isPermaLink="false">8369@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi there,&#60;/p&#62;
&#60;p&#62;I have form 1,  which I would like to show up as a draft post under custom post type &#34;pv_listing&#34; and form 2, which I would like to show up as a draft post under custom post type &#34;pv_events&#34;&#60;/p&#62;
&#60;p&#62;This thread &#60;a href=&#34;http://forum.gravityhelp.com/topic/add-a-form-to-create-a-new-custom-post-type#post-3425&#34; rel=&#34;nofollow&#34;&#62;http://forum.gravityhelp.com/topic/add-a-form-to-create-a-new-custom-post-type#post-3425&#60;/a&#62; worked fine for me when I only had 1 form for 1 custom post type.&#60;/p&#62;
&#60;p&#62;So I tried to improvise, first by copying, amending, and pasting the whole snippet of code for form 2. When that didn't work, I tried modifying as below.  I have zero coding skills, so both tries just made my screen go blank.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter( &#38;quot;gform_post_data&#38;quot;, &#38;quot;update_post_type&#38;quot;, 10, 2 );
function update_post_type( $post_data, $form ) {
	if( $form[&#38;quot;id&#38;quot;] == &#38;#39;1&#38;#39; ) {
		$post_data[&#38;quot;post_type&#38;quot;] = &#38;quot;pv_listing&#38;quot;;
	elseif( $form[&#38;quot;id&#38;quot;] == &#38;#39;2&#38;#39; ) {
		$post_data[&#38;quot;post_type&#38;quot;] = &#38;quot;pv_event&#38;quot;;
	}
	return $post_data;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Can you let me know the correct way to do this?&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
