Themergency

Gravity Forms + Custom Post Types

Current version 3.0.1
Downloaded 27142 times!
View this page on WordPress.org

This plugin is an add-on for the amazing Gravity Forms Plugin.
Check out my other free Add-ons for Gravity Forms

Gravity forms allows you to create posts from a form using ‘post fields’. By default the submitted form will create a post, but I wanted a way to save a custom post type instead. It can be done quite easily with some php code, but I wanted it to be easier without any code at all. Now it is easy. Maybe too easy :)

You can also link a custom taxomony to the field types : Drop Downs, Mulit Selects, Radio Buttons, Checkboxes and Single Line Text. So when the form is displayed a list of terms for the custom taxonomy are listed. And then when the post (or custom post type) is created, it automatically links the post to the selected taxonomy term(s).

features

  • Map a form to a custom post type (using the post title field)
  • Map fields (Drop Downs, Multiple Choice or Checkboxes) to a custom taxonomy
  • Supports Gravity Forms v1.5 and over (including v1.6)
  • Ability to have more than 1 taxonomy linked in a form (see screenshots)
  • Hierarchical dropdowns for hierarchical taxonomies (see screenshots)
  • Populate a dropdown with posts
  • Ability to set a parent post using the dropdown control
  • Single line text field can link to taxonomies by entering a comma seperated list
  • Enhanced UI on single line text fields to show a “tag input” styled control (see screenshots)

How to map a form to a custom post type

Add a post title field to your form and under the advanced tab, tick the “Save As Post Type” checkbox. A dropdown will appear with the available post types. Select the one you want.

How to link a field to a custom taxonomy

Custom taxonomies can be linked to Drop Downs, Mulit Selects, Radio Buttons and Checkboxes. Under the advanced tab for your field, tick the “Populate with a Taxonomy” checkbox. A dropdown will appear and you can select your custom taxonomy from the list.

How to link the saved post to taxonomies using a single line text field

You can also link a Single Line Text field to a taxonomy, so it can be used to input existing and new taxonomy terms. Under the Advanced tab, click “Save to Taxonomy” checkbox and then select the taxonomy from thr drop down. You can also choose to show an advanced UI by checking the “Enable enhanced UI” checkbox. This will enable an awesome “tag input” style control. See screenshot for more info. If the control contains exising terms, then they are linked to the saved post. If there are new terms in the control, then the terms are created and they are also linked.

How to set a parent post with the dropdown field

You can now link the dropdown field to a post type and try to make it set the parent item. Under the advanced tab, check the “Populate with Post Type” checkbox. Select the SAME post type that you selected when adding a post title field (above), and check “Try to set parent”. This then fills the dropdown with a list of existing posts, so when you save the form and the post is created, it trys to set the parent post to whatever was selected in the dropdown.

Download

Latest version: Download Gravity Forms + Custom Post Types v3.0.1 [zip]

Installation

  1. Upload the plugin folder ‘gravity-forms-custom-post-types’ to your /wp-content/plugins/ folder
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Make sure you also have Gravity Forms activated.

FAQ

Q. Does this plugin rely on anything?
A. Yes, you need to install the Gravity Forms Plugin for this plugin to work.

Changelog

3.0.1

  • Fixed minor bug causing a PHP warning (FILE)
  • removed the restriction of not including scripts when a call is ajax

3.0

  • Removed support for Gravity Forms v1.4.5. Now supports v1.5 and up (including 1.6)
  • Added support for single line text fields
  • Added ability to populate a dropdown with posts
  • Added ability to set a parent post when saving a post form
  • Multiselect control now supports “populate with taxonomy” too
  • “first value” default overriden when populating with a taxonomy
  • Shows taxonomy selections when designing the form
  • Fixed support for conditional logic
  • Previews now load taxonomy terms
  • Previews can show enhanced UI (only in V1.6 and above)

2.0

  • Added support for both Gravity Forms v1.5 beta and v.1.4.5
  • Now supports linking taxonomies to Drop Downs, Multiple Choice or Checkboxes
  • Integrated with GF v1.5 hooks for easier configuration (thanks to Alex and Carl from RocketGenius)
  • Support linking more than 1 taxonomy to a form
  • To keep in line with the GF standards, mapping a form to a CPT in GF v1.4.5 can now be done via the ‘post title’ field

1.0

  • Initial Relase. First version.
Post comment as twitter logo facebook logo
Sort: Newest | Oldest
BruceGilbert 5 pts

I have gravity forms installed and activated and also gravity forms custom post types. When I add a form field and go to the advanced tab, I don't see the option to 'save as post type' as should be displaying. What could I have done wrong?

themergency 10 pts moderator

 BruceGilbert what version of GF are you using?

BruceGilbert 5 pts

 themergency  BruceGilbert I think it is o.2.1. Is the post title field the only field where you can check 'save as post type'? I see that option on that field, but not the others.

energy0m 5 pts

hey first off AWESOME plugin ... questions though... for some reason whenever i do the taxonomy link it will not allow the data of multiple taxonomies if selected to be submitted. Only the first taxonomy once selected gets set.. have you ever seen this behavior ? any suggestions for a fix?

MartinJarvis 5 pts

I'm using v3.0.1 of this plugin alongside GravityForms, the GF Paypal Addon and GF User Registration addon. The additional custom post type that my form entries are creating for new users has an additional capability for their role 'Upload Files'. All works fine, but I sometimes see that this capability gets reset for this role type and I think it happens when a new user registers.

 

Just to eliminate it from my enquiries - is there anywhere in this plugin that will change / reset user capabilities?

themergency 10 pts moderator

 MartinJarvis There is nothing in GF+CPT that changes or resets user capabilities

MartinJarvis 5 pts

 themergency  MartinJarvis Thanks for the really swift response. I guess I need to look elsewhere for the problem.

danromanchik 5 pts

I just installed this plugin and set up a form to add custom posts. It works great, except for the dropdown field. For some reason, the value of the dropdown is not being saved  in the custom post. Is there some trick to get this to work?

themergency 10 pts moderator

 danromanchik Is the dropdown linked to a taxonomy?

mtedwards 5 pts

Hi Guys,

 

Ran into an issue and can't seem to sort it out.

 

I have the pluging working perfectly with one form and a custom post type. However on my second custom post type and second form I just end up with posts that are titled "Undefined" and hold no data.

 

I am also receiving this error:  Invalid argument supplied for foreach() in XXX/wp-content/plugins/gravityforms/forms_model.php on line1855

 

Any ideas would be greatly appreciated.

themergency 10 pts moderator

 mtedwards hard to tell just from this description. Are you sure you have a post title field in the form?

mtedwards 5 pts

 themergency Hi, Yes I do. I've started cutting things down to try and work out the issue..I now only have a title and content field, and it still creates a new post, but the title is Untitled and the Content  blank.

JasonKenney 5 pts

Great plugin but doesn't seem to quite work all the way. I'm trying to use it with Gravity Forms to create a sort of guestbook, pinprick on a map feature for a website. and I'm testing it here:

 

http://serialprizes.com/?page_id=165

 

The problem is it posts the custom type just fine, but I need to go into WP's backend and click publish a second time to get it to actually go live - this is despite having the "Post Status" field set to "Published".

 

Am I missing a step or maybe it's an issue with the map plugin?

 

Thanks!

Jason

JennyChalek 5 pts

I'm coming across an odd problem I can't seem to see mentioned anywhere either in here or on gravity forms itself. After installing your plugin, everything seems to work great EXCEPT that any field label that has an apostrophe in it keeps doubling the apostrophe every time you update the form. I'm turns into I''m turns into I'''''''m etc. Even when you forcibly delete the whole field and enter only exactly one apostrophe, it still doubles upon saving. Have you come across this? Is there a fix if so, or am I going to have to hack the database?

themergency 10 pts moderator

 JennyChalek how is this related to the GF+CPT addon? Are you saying the values in the form are doubling the apostrophes, or are the form labels within the backend giving the problem?

JennyChalek 5 pts

 themergency The form labels on every single form field within the backend are doing this each time I save the form while editing it.

JennyChalek 5 pts

 themergency I don't know for certain if it's related, but since it wasn't happening until I installed your addon, I thought I would check to see if it's a known issue.

Steve Graham 5 pts

I have set up a form to use a checkbox linked to a custom taxonomy on a custom post type. When I fill the form i get an error saying the field is required (which it is) however, I get this whether the field 'Cub Membership' is populated or not. Any ideas? http://enterprisingwomensouth.co.uk/members-area/membership-form/

Steve Graham 5 pts

 Steve Graham No idea what the problem was BUT I deleted the field and started agaiun and now it's working. Cheers

Mactonex 5 pts

Hi,

I recently tested the Gravity forms user registration add-on but unfortunately it conflicted with your custom post type plugin. Have you come across this before? any ideas how to resolve this would be most appreciated as I use your plug in for an events registration system. I'm using the latest Gravity Forms.

codearachnid 5 pts

I'm curious if you have functionality in place or how hard it would be to add the gravity form entry id as a custom field value?

bangbangmobile 6 pts

Please combine this plugin and your WYSIWYG plugin so we can have a decent editor in the Custom Post Type body.  That would be awesome!!

graftedin 5 pts

Hi there, love your plugin but have a quick question.  For custom taxonomies is there a way to limit the number of items shown?  

 

For example...I have 2 parent categories and multiple sub categories in my custom taxonomy.  

 

I would like to create a form for each of the parent categories and corresponding children using the custom taxonomy field.  I have tried deleting the categories that I don't need but it repopulates on save.  

 

Can you direct me to a way to accomplish this?  I am not afraid of php I am just not good at writing it.

 

Thanks!

Trisha

yammy 5 pts

Hi. I'm using gravity 1.6.9 and custom-post-type 3.0.1 versions. I noticed that when I select Save as Post Type and chose another post type, when I go to the Properties tab, the categories doesn't show the post type categories as well. This way I can't assign the post type's right category.Can you give a fix for that ? Thanks for great mod !

AlbertoMacaluso 5 pts

There is some problem with the version 1.6.51. When i try to populate a drop downs with taxonomy and save the form in the backend (when you build the form) it dosnt works and dont save the taxonomy

dlishus 6 pts

I am using this plugin and am populating a dropdown with a cpt. It's working great, however, I'd like to switch the order form Z-A to A-Z. Is that possible?

gcprive 5 pts

Hello, could you please help me do the following...

 

Dropdown menu (what the end-user sees) needs to have fixed names such as:

 

Going Out Well Being Fashion etc...

 

corresponding to custom post types:

 

os_going_out os_well_being os_fashion etc...

 

When the user submits the form, then the post will be converted accordingly

matthew1 5 pts

Great plugin!  Thank you for making it.  1 question: how hard would it be to be able to map a date field to a custom field name?  If you wanted to add it to the plugin that would be great, or if you could shoot me the code I could just add it to my theme's functions.php file.  Thanks!

lwrkrol 5 pts

Great plugin in combination with custom post types ! BUT, i have got a bit of a challenge, let me explain my goal:

- I use GF plugin

- I use this plugin 

- I use WP Types to handle my custom post types and fields

 

I made 2 custom posttypes: shop and offer (WP-Types). Offer is a child of shop so this makes Shop the parent. I connected these two custom posttypes using WP Types.

In Admin I can add a shop, then add multiple offers for this shop (I can select the shop where I add the offer).

Now I want users to add a shop and multiple offers on the frontend using gravity forms and this plugin. I made a form to add a shop and a form to add the offers. Both forms add the shop and the offers, the problem is that I have to manually connect the offer to the shop using Admin and editing the offer. 

 

So, how can I achieve a connection between the shop and the offer. I tried making a form where you enter a description for an offer and then select the shop in a dropdown box but there is no connection made between this offer and the shop.

 

Hope someone can assist.

 

Luit

yajanssen 5 pts

I have a problem the user (frontend) is not able to tab to the next field.

Moonworks 5 pts

Hi, I seem to be having a problem when using the multiple select field.

 

It is only adding the first thing selected, everything else is ignored.

 

I created a basic form, just to make sure it wasn't due to a large number of form fields, but I get the same problem.

scubamarketing 7 pts

I'm populating a checkbox group from a taxonomy, is there any way to re-order the items? I'm using certifications that have their own order of progression, so alphabetical isn't ideal unfortunately.

Moonworks 5 pts

 scubamarketing  You should be able to change the order within the WP aqdmin, and then it should show up in that order.

drdavis74 5 pts

Hi. I have installed this 20 times now and I am still not seeing the "set featured image" checkbox that is supposed to be there.  I am desperate to get this to work. Help me please

themergency 10 pts moderator

 drdavis74 the featured image is not part of this plugin. That is part of the gravity forms core plugin. When adding a image field to a form, there is an option to set the image as the feratured image. It should be there when viewing the field options for an image field

brianh04 5 pts

Hello. I posted on the wordpress support forum regarding the "custom field" field not displaying a list of custom fields to choose from. bradvin got back to me super quick, but it still is not working. i really need this working as soon as possible, because our new "software" that this hinges on is supposed to launch monday. i also just made a donation to hopefully speed up the support resolution process! it came from alliance leads in irvine, ca on macarthur blvd. so i hope that helps! if not, you guys made a great plugin (epic plugin if the custom fields field works) and you deserve it anyway. 

sangfroidweb 5 pts

I have 2 custom post types.. One of them shows up in the "Save as post type" dropdown.. but the other does not.. any ideas? They are both set up almost identically.. I'm not sure why one shows up and the other one does not.

danromanchik 5 pts

 sangfroidweb Did you ever figure out why this is happening? I'm having the same  trouble here.

opsec 5 pts

I'm also having the problem where "save as post type" is not showing up under the advanced tab in gravity forms editor. Using a bare install of WP 3.4.1, GF 1.6.4.5.4 and Gravity Forms + Custom Post Types 3.0.1.. I'm not new at this so I'm not sure what I'm missing here. Any hints would be appreciated.

themergency 10 pts moderator

 opsec please can you try the GF+CPT 4 beta and see if you still have the issue. I think it is about time I update the plugin to 4 :)

opsec 5 pts

 themergency thanks for the speedy reply, where do I find the beta?

opsec 5 pts

 themergency I found it here: http://themergency.com/gfcpt-beta-download/ with a google search, thanks. I'll let you know how it works.

opsec 5 pts

 themergency Ok, i've installed the beta4 and the issue remains. I've taken some screenshots here:

http://adslinger.com/images/screenshot-2.png

http://adslinger.com/images/screenshot-3.png

 

Thanks

themergency 10 pts moderator

 opsec thanks for testing and sharing your screenshots :)

The "save as post type" option is only available under the advanced tab for the post title field, and not the form settings.

opsec 5 pts

 themergency ok, I must be missing something very obvious because I cannot find what you're talking about.

 

I've gone to posts --> all posts --> clicked on a post to edit

can't find anything here regarding "advanced".

 

i've also gone to my CPT "lawfirm" and added a new post but still do not see this "advanced" tab anywhere other than the gravity forms editor.

 

Could you please point me to the path from the admin that I should find the advanced tab?

 

Thanks

themergency 10 pts moderator

 opsec create a new form. Add a post title field (because you want to save the entry to a CPT) then click on the post title field to expand it's options. Now click the advanced tab that appears. Under that tab you should see "Save as post type"

opsec 5 pts

 themergency Thanks a lot! that helped. I was confusing "post title field" with the title field of the custom post type itself. Cheers.

miralize 7 pts

Are there any updates for this? Doesnt seem to work for me anymore on 3.4

nickgrossman 5 pts

 miralize Same here. I just installed gravityforms 1.6.4.5.4 with wordpress 3.4 and I'm not seeing the "save as post type" option under my form settings.