<?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: Import form on plugin activation</title>
		<link>https://legacy.forums.gravityhelp.com/topic/import-form-on-plugin-activation</link>
		<description>Gravity Support Forums Topic: Import form on plugin activation</description>
		<language>en-US</language>
		<pubDate>Tue, 21 Apr 2026 20:19:06 +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/import-form-on-plugin-activation" rel="self" type="application/rss+xml" />

		<item>
			<title>NWTD on "Import form on plugin activation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/import-form-on-plugin-activation#post-195611</link>
			<pubDate>Wed, 03 Apr 2013 13:43:00 +0000</pubDate>
			<dc:creator>NWTD</dc:creator>
			<guid isPermaLink="false">195611@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Chris, my issue is resolved but I'm not sure how to close this thread.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>NWTD on "Import form on plugin activation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/import-form-on-plugin-activation#post-194710</link>
			<pubDate>Tue, 02 Apr 2013 18:44:16 +0000</pubDate>
			<dc:creator>NWTD</dc:creator>
			<guid isPermaLink="false">194710@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I got it working using the following:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;define(&#38;quot;GF_IMPORT_FILE&#38;quot;, &#38;quot;http://mydomain.com/plugin-directory/get-a-free-estimate.xml&#38;quot;);
function nwtd_lpfs_import_form() {
	if(defined(&#38;quot;GF_IMPORT_FILE&#38;quot;) &#38;amp;&#38;amp; !get_option(&#38;quot;gf_imported_file&#38;quot;)){
        GFExport::import_file(GF_IMPORT_FILE);
        update_option(&#38;quot;gf_imported_file&#38;quot;, true);
    }
}
add_action(&#38;#39;init&#38;#39;, &#38;#39;nwtd_lpfs_import_form&#38;#39; );&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Using just &#60;code&#62;GFExport::import_file(get_stylesheet_directory() . &#38;quot;/&#38;quot; . GF_THEME_IMPORT_FILE);&#60;/code&#62; added two of the forms upon plugin activation and another upon plugin deactivation.&#60;/p&#62;
&#60;p&#62;Thanks for your help Chris!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Import form on plugin activation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/import-form-on-plugin-activation#post-194699</link>
			<pubDate>Tue, 02 Apr 2013 18:31:13 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">194699@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Looks like this is what happens when a theme is activated and that constant is defined:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
GFExport::import_file(get_stylesheet_directory() . &#38;quot;/&#38;quot; . GF_THEME_IMPORT_FILE);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;You could call the same function when your plugin is activated, with a different constant, and a different location.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>NWTD on "Import form on plugin activation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/import-form-on-plugin-activation#post-194697</link>
			<pubDate>Tue, 02 Apr 2013 18:27:58 +0000</pubDate>
			<dc:creator>NWTD</dc:creator>
			<guid isPermaLink="false">194697@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;My apologies, I responded before you added more details to your initial response. I'll look into the GF_THEME_IMPORT functionality.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Import form on plugin activation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/import-form-on-plugin-activation#post-194689</link>
			<pubDate>Tue, 02 Apr 2013 18:09:46 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">194689@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;It won't work on plugin activation.  I was hoping your could look at how the code works on theme activation, and you could modify that to work in your plugin, so that when the plugin is activated, you can run the same type of code to import your XML file containing the form.&#60;/p&#62;
&#60;p&#62;This functionality: &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Advanced_Configuration_Options#GF_THEME_IMPORT_FILE&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Advanced_Configuration_Options#GF_THEME_IMPORT_FILE&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>NWTD on "Import form on plugin activation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/import-form-on-plugin-activation#post-194681</link>
			<pubDate>Tue, 02 Apr 2013 18:06:12 +0000</pubDate>
			<dc:creator>NWTD</dc:creator>
			<guid isPermaLink="false">194681@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for the quick response Chris. This solution seems like it's only applicable to when a new site is created on a multisite network. Is there a way to use the GF_IMPORT_FILE on plugin activation?&#60;/p&#62;
&#60;p&#62;I tried adding &#60;code&#62;define(&#38;quot;GF_IMPORT_FILE&#38;quot;, &#38;quot;http://mydomain.com/plugin-direcory/get-a-free-estimate.xml&#38;quot;);&#60;/code&#62; to my plugin file and on activation, the form was not imported.&#60;/p&#62;
&#60;p&#62;Thanks for your help!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Import form on plugin activation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/import-form-on-plugin-activation#post-194666</link>
			<pubDate>Tue, 02 Apr 2013 17:53:46 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">194666@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This will work upon site creation in multisite:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Advanced_Configuration_Options#GF_IMPORT_FILE&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Advanced_Configuration_Options#GF_IMPORT_FILE&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;This will work when a theme is activated:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Advanced_Configuration_Options#GF_THEME_IMPORT_FILE&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Advanced_Configuration_Options#GF_THEME_IMPORT_FILE&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I think you could copy the code that is used for the GF_THEME_IMPORT functionality and adapt it to your plugin application.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>NWTD on "Import form on plugin activation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/import-form-on-plugin-activation#post-194660</link>
			<pubDate>Tue, 02 Apr 2013 17:50:03 +0000</pubDate>
			<dc:creator>NWTD</dc:creator>
			<guid isPermaLink="false">194660@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have a small plugin for my multisite that essentially registers a custom post type and on activation I would like it to import a gravity form that I had previous created and exported.&#60;/p&#62;
&#60;p&#62;Is there any documentation or help that I can get that might point me in the right direction for importing a gravity form upon plugin activation?&#60;/p&#62;
&#60;p&#62;TIA
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
