<?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: url of the post generated with Create content template</title>
		<link>https://legacy.forums.gravityhelp.com/topic/url-of-the-post-generated-with-create-content-template</link>
		<description>Gravity Support Forums Topic: url of the post generated with Create content template</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 21:58:53 +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/url-of-the-post-generated-with-create-content-template" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "url of the post generated with Create content template"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/url-of-the-post-generated-with-create-content-template#post-31144</link>
			<pubDate>Thu, 28 Jul 2011 13:11:52 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">31144@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello again.  This part right here is what adds it to the end:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;$post-&#38;gt;post_content .=&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;The &#60;strong&#62;.=&#60;/strong&#62; just appends it to the original post content.  When you say &#34;put a shortcode&#34; do you mean the person submitting the form would enter the shortcode (which is a lot to expect of a visitor) or somehow you know where the link needs to be in the post body?&#60;/p&#62;
&#60;p&#62;In the latter case, if your post body is just one field it's going to be harder to do.  You'd have to look for some text in the submission, then insert your link there.  You would do that with a regular expression using this same code.&#60;/p&#62;
&#60;p&#62;If your content template (post body) is made up of various form fields, then it will be much easier to do, because you have knowledge of what's going to be into the post.&#60;/p&#62;
&#60;p&#62;Please post your content template here with a notation of where you want the URL and I will help you get the URL in there using this function.  Thank you.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jbdurand on "url of the post generated with Create content template"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/url-of-the-post-generated-with-create-content-template#post-31122</link>
			<pubDate>Thu, 28 Jul 2011 10:17:36 +0000</pubDate>
			<dc:creator>jbdurand</dc:creator>
			<guid isPermaLink="false">31122@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you for your code. It is working.&#60;br /&#62;
Would it be possible to put a shortcode in the exact place of the (gravity generated) post where the url should appear?&#60;br /&#62;
for the moment it appears at the end of the post.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "url of the post generated with Create content template"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/url-of-the-post-generated-with-create-content-template#post-30838</link>
			<pubDate>Sun, 24 Jul 2011 16:21:52 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">30838@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi jbdurand.  I was able to accomplish this using the &#60;strong&#62;gform_post_submission&#60;/strong&#62; hook.  The hook is documented here:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_post_submission&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_post_submission&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;That hook allows you to modify the post content after the entry is submitted.  Since we have the post_id at that point (after the entry is submitted), it's pretty easy to access everything contained in the post object.&#60;/p&#62;
&#60;p&#62;Here's the code I used:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
// change the number 2 below to your form ID
add_action(&#38;#39;gform_post_submission_2&#38;#39;, &#38;#39;change_post_content&#38;#39;, 10, 2);
function change_post_content($entry, $form) {

    // get the post created by this form entry
    $post = get_post($entry[&#38;#39;post_id&#38;#39;]);

    // get title of the post
    $title = $post-&#38;gt;post_title;

    // get the site url
    $url = site_url();

    // build the permalink
    $permalink = $url . &#38;#39;/?p=&#38;#39; . $entry[&#38;#39;post_id&#38;#39;];

    // modify the post_content by appending the URL
    $post-&#38;gt;post_content .= &#38;quot;\n&#38;lt;br style=&#38;#39;clear:both;&#38;#39; /&#38;gt;Permanent to this post: &#38;lt;a href=&#38;#39;$permalink&#38;#39; title=&#38;#39;Permanent link to $title&#38;#39;&#38;gt;$title&#38;lt;/a&#38;gt;\n&#38;quot;;

    // update post
    wp_update_post($post);

}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;That code will be entered into your theme's functions.php.    &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F&#34; rel=&#34;nofollow&#34;&#62;Here's some documentation&#60;/a&#62; on where to put this code.&#60;/p&#62;
&#60;p&#62;Here's the reference for the post object:&#60;br /&#62;
&#60;a href=&#34;http://codex.wordpress.org/Function_Reference/get_post&#34; rel=&#34;nofollow&#34;&#62;http://codex.wordpress.org/Function_Reference/get_post&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Be sure to change the &#34;_2&#34; on the end of the &#60;strong&#62;gform_post_submission&#60;/strong&#62; hook to your form ID, or remove the _2 altogether if you want this code to be run for all Gravity Forms forms on your site.  If you need any more help, please let us know.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jbdurand on "url of the post generated with Create content template"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/url-of-the-post-generated-with-create-content-template#post-30837</link>
			<pubDate>Sun, 24 Jul 2011 13:35:22 +0000</pubDate>
			<dc:creator>jbdurand</dc:creator>
			<guid isPermaLink="false">30837@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;br /&#62;
I would like to insert the url of the article within the post body of the article itself that will be generated with the &#34;Post Content Template&#34;.&#60;br /&#62;
I didn't find this function in the &#34;insert form field&#34; menu list. &#60;/p&#62;
&#60;p&#62;{embed_url} is the url of the page where the form is located&#60;br /&#62;
{entry_url} is the url of the entry in the dashboard&#60;br /&#62;
{post_edit_url} is the url of the articles list page for editing&#60;/p&#62;
&#60;p&#62;so is there any code for the url of the generated post?&#60;/p&#62;
&#60;p&#62;Best regards
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
