<?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: Integrating Posts 2 Posts</title>
		<link>https://legacy.forums.gravityhelp.com/topic/integrating-posts-2-posts</link>
		<description>Gravity Support Forums Topic: Integrating Posts 2 Posts</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 08:21:13 +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/integrating-posts-2-posts" rel="self" type="application/rss+xml" />

		<item>
			<title>sascha on "Integrating Posts 2 Posts"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrating-posts-2-posts#post-70004</link>
			<pubDate>Tue, 07 Aug 2012 19:25:38 +0000</pubDate>
			<dc:creator>sascha</dc:creator>
			<guid isPermaLink="false">70004@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I assume you could set up the same functionality with GF. I remember a few forum posts about auto completion. So get your post ID for CPT1, then for CPT2 and connect after submission with a post 2 post function. Obviously you have to do the leg work to auto-complete the post name...&#60;br /&#62;
I guess best thing is to look at the post 2 post code and then adapt it or look in the GF forum again or ask the GF guys outright how to achieve auto completion....&#60;br /&#62;
Good luck!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jonathan Dingman on "Integrating Posts 2 Posts"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrating-posts-2-posts#post-69972</link>
			<pubDate>Tue, 07 Aug 2012 16:34:27 +0000</pubDate>
			<dc:creator>Jonathan Dingman</dc:creator>
			<guid isPermaLink="false">69972@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for the response Sascha.&#60;/p&#62;
&#60;p&#62;The way that Posts 2 Posts works though, is it lets you start typing a Post and it will auto-complete, retrieving data from the database via AJAX.  I can't pre-populate everything together for Posts 2 Posts to work, as far as I know.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sascha on "Integrating Posts 2 Posts"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrating-posts-2-posts#post-69821</link>
			<pubDate>Tue, 07 Aug 2012 04:11:58 +0000</pubDate>
			<dc:creator>sascha</dc:creator>
			<guid isPermaLink="false">69821@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I think the admin boxes of post 2 post are just meant for the admin screen in WP. Not sure if they would work in the front end?&#60;/p&#62;
&#60;p&#62;I would set up my form, so that I have a drop down that populates with the choices for the CPT2 and then use the gf_after_submission hook to connect the two posts (the just created one and the one chosen from the drop down). You can use a posts2posts function to make that connection, just look in the source or documentation.&#60;/p&#62;
&#60;p&#62;My licence on GF runs out tonight, so is likely that I'll not be able to check your answer! Hope you get there.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jonathan Dingman on "Integrating Posts 2 Posts"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrating-posts-2-posts#post-69764</link>
			<pubDate>Mon, 06 Aug 2012 19:57:02 +0000</pubDate>
			<dc:creator>Jonathan Dingman</dc:creator>
			<guid isPermaLink="false">69764@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;But getting back to my point of Posts 2 Posts.&#60;/p&#62;
&#60;p&#62;I'm trying to add a custom admin box to an input field.  This is the example code they provide to build your own admin box.&#60;/p&#62;
&#60;p&#62;Any direction how I would go about implementing this into the code beneath it?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action( &#38;#39;init&#38;#39;, &#38;#39;init_my_connection_type&#38;#39;, 100 );
add_action( &#38;#39;add_meta_boxes&#38;#39;, &#38;#39;register_my_meta_box&#38;#39; );

function init_my_connection_type() {
	p2p_register_connection_type( array(
		&#38;#39;name&#38;#39; =&#38;gt; &#38;#39;posts_to_pages&#38;#39;,
		&#38;#39;from&#38;#39; =&#38;gt; &#38;#39;post&#38;#39;,
		&#38;#39;to&#38;#39; =&#38;gt; &#38;#39;page&#38;#39;,
		&#38;#39;admin_box&#38;#39; =&#38;gt; false
	) );
}

function register_my_meta_box() {
	add_meta_box( &#38;#39;my-box&#38;#39;, &#38;#39;My Connected Pages&#38;#39;, &#38;#39;render_my_meta_box&#38;#39;, &#38;#39;post&#38;#39; );
}

function render_my_meta_box( $post ) {
	echo &#38;#39;This is my box.&#38;#39;;

	$ctype = p2p_type( &#38;#39;posts_to_pages&#38;#39; )-&#38;gt;get_connected( $post );
?&#38;gt;

&#38;lt;ul&#38;gt;
&#38;lt;?php while ( $connected-&#38;gt;have_posts() ) : $connected-&#38;gt;the_post(); ?&#38;gt;
	&#38;lt;li&#38;gt;&#38;lt;a href=&#38;quot;&#38;lt;?php the_permalink(); ?&#38;gt;&#38;quot;&#38;gt;&#38;lt;?php the_title(); ?&#38;gt;&#38;lt;/a&#38;gt;&#38;lt;/li&#38;gt;
&#38;lt;?php endwhile; ?&#38;gt;
&#38;lt;/ul&#38;gt;
&#38;lt;?php
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and..&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action( &#38;quot;gform_field_input&#38;quot; , &#38;quot;wps_tos_field_input&#38;quot;, 10, 5 );
function wps_tos_field_input ( $input, $field, $value, $lead_id, $form_id ){

    if ( $field[&#38;quot;type&#38;quot;] == &#38;quot;c_cpt&#38;quot; ) {
		$max_chars = &#38;quot;&#38;quot;;
		if(!IS_ADMIN &#38;amp;&#38;amp; !empty($field[&#38;quot;maxLength&#38;quot;]) &#38;amp;&#38;amp; is_numeric($field[&#38;quot;maxLength&#38;quot;]))
			$max_chars = self::get_counter_script($form_id, $field_id, $field[&#38;quot;maxLength&#38;quot;]);

		$input_name = $form_id .&#38;#39;_&#38;#39; . $field[&#38;quot;id&#38;quot;];
		$tabindex = GFCommon::get_tabindex();
		$css = isset( $field[&#38;#39;cssClass&#38;#39;] ) ? $field[&#38;#39;cssClass&#38;#39;] : &#38;#39;&#38;#39;;
		return sprintf(&#38;quot;&#38;lt;div class=&#38;#39;ginput_container&#38;#39;&#38;gt;&#38;lt;textarea readonly name=&#38;#39;input_%s&#38;#39; id=&#38;#39;%s&#38;#39; class=&#38;#39;textarea gform_tos %s&#38;#39; $tabindex rows=&#38;#39;10&#38;#39; cols=&#38;#39;50&#38;#39;&#38;gt;%s&#38;lt;/textarea&#38;gt;&#38;lt;/div&#38;gt;{$max_chars}&#38;quot;, $field[&#38;quot;id&#38;quot;], &#38;#39;ccpt-&#38;#39;.$field[&#38;#39;id&#38;#39;] , $field[&#38;quot;type&#38;quot;] . &#38;#39; &#38;#39; . esc_attr( $css ) . &#38;#39; &#38;#39; . $field[&#38;#39;size&#38;#39;] , esc_html($value));

    }

    return $input;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Jonathan Dingman on "Integrating Posts 2 Posts"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrating-posts-2-posts#post-69762</link>
			<pubDate>Mon, 06 Aug 2012 19:35:31 +0000</pubDate>
			<dc:creator>Jonathan Dingman</dc:creator>
			<guid isPermaLink="false">69762@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Actually nevermind, think I found one that will work.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://wpsmith.net/2011/plugins/how-to-create-a-custom-form-field-in-gravity-forms-with-a-terms-of-service-form-field-example/&#34; rel=&#34;nofollow&#34;&#62;http://wpsmith.net/2011/plugins/how-to-create-a-custom-form-field-in-gravity-forms-with-a-terms-of-service-form-field-example/&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jonathan Dingman on "Integrating Posts 2 Posts"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrating-posts-2-posts#post-69761</link>
			<pubDate>Mon, 06 Aug 2012 19:34:02 +0000</pubDate>
			<dc:creator>Jonathan Dingman</dc:creator>
			<guid isPermaLink="false">69761@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I tried the latter as well, gform_field_input and as you described, it's not very flexible.  I couldn't get it to work.&#60;/p&#62;
&#60;p&#62;I'm a little surprised there's so little documentation around creating a basic custom field..having a heck of a time trying to find a basic example that is straight forward to follow.&#60;/p&#62;
&#60;p&#62;Any other docs you can point me to that are a little more thorough, but still basic enough to follow?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Integrating Posts 2 Posts"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrating-posts-2-posts#post-69757</link>
			<pubDate>Mon, 06 Aug 2012 19:21:55 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">69757@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;People also use the following, but it is less flexible - &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_field_input&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_field_input&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Integrating Posts 2 Posts"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrating-posts-2-posts#post-69756</link>
			<pubDate>Mon, 06 Aug 2012 19:21:27 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">69756@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Sorry about that. Having a bit of an off day. Here is the documentation that I think you need to create a field in a form:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_field_content&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_field_content&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jonathan Dingman on "Integrating Posts 2 Posts"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrating-posts-2-posts#post-69751</link>
			<pubDate>Mon, 06 Aug 2012 19:06:45 +0000</pubDate>
			<dc:creator>Jonathan Dingman</dc:creator>
			<guid isPermaLink="false">69751@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I've tried following those docs and they weren't very helpful.  It only let me add a settings for all existing Fields, not let me add my own.  Maybe I'm missing something though.&#60;/p&#62;
&#60;p&#62;I copied that code verbatim to my functions.php, but it didn't create a new field.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Integrating Posts 2 Posts"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrating-posts-2-posts#post-69738</link>
			<pubDate>Mon, 06 Aug 2012 18:11:31 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">69738@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Here is some documentation about creating your own field type:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_field_advanced_settings&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_field_advanced_settings&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Would that help?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
