Title: Gravity Forms + Custom Post Types
Author: Dave from Gravity Wiz
Published: <strong>2011 年 2 月 21 日</strong>
Last modified: 2026 年 4 月 14 日

---

搜索插件

![](https://ps.w.org/gravity-forms-custom-post-types/assets/banner-772x250.jpg?rev
=2542252)

![](https://ps.w.org/gravity-forms-custom-post-types/assets/icon-256x256.png?rev
=2542252)

# Gravity Forms + Custom Post Types

 作者：[Dave from Gravity Wiz](https://profiles.wordpress.org/spivurno/)

[下载](https://downloads.wordpress.org/plugin/gravity-forms-custom-post-types.3.1.31.zip)

 * [详情](https://cn.wordpress.org/plugins/gravity-forms-custom-post-types/#description)
 * [评价](https://cn.wordpress.org/plugins/gravity-forms-custom-post-types/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/gravity-forms-custom-post-types/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/gravity-forms-custom-post-types/#developers)

 [支持](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/)

## 描述

This plugin is an add-on for [Gravity Forms](http://gravityforms.com). Make sure
you visit [GravityWiz.com](http://gravitywiz.com/plugins/) for more **free** Gravity
Forms resources. And if you’re looking to the largest collection of Gravity Forms
plugins, check out [Gravity Perks](http://gravityperks.com).

Gravity Forms allows you to create posts from a form submission using special Post
Fields. By default, the submitted form will be created as a standard WordPress post.
This plugin allows you to change the post type of the generated post. **No code 
required!** This plugin also provides the ability to assign the generated post to
a custom taxonomy.

Need to update posts? Learn [how to update posts with Gravity Forms](https://gravitywiz.com/how-to-update-posts-with-gravity-forms/).

#### Features

 * Map posts to a custom post type
 * Map posts to a custom taxonomy (via Drop Down, Multi-select, Radio Button or 
   Checkbox field)
 * Map posts to multiple taxonomies
 * Visual hierarchy support for hierarchical taxonomies (Drop Down field only)
 * Populate a Drop Down with posts
 * Assign parent post for generated post (Drop Down field only)
 * Single Line Text field support for taxonomies (enter as a comma-delimited list:
   term a, term b, term c)
 * Enhanced UI support for Single Line Text fields (see screenshots)

#### How to map a form to a custom post type

 1. Add a Post Title field to your form and click on it to open the field settings.
 2. Below the “Description” field setting, you will find the “Post Type” setting.
 3. Select the desired post type from the drop down (default is “Posts”).

#### How to link a field to a custom taxonomy

 1. Add the desired field to which the custom taxonomy should be mapped. Drop Down,
    Multi Select, Radio Buttons and Checkboxes fields are current supported.
 2. Open the field settings by clicking on the field and click on the “Advanced” tab.
 3. Check the “Populate with a Taxonomy” checkbox.
 4. Select the desired taxonomy from the drop down that appears.

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

Single Line Text fields are a great way to allow users to select existing taxonomy
terms and to also add new terms.

 1. Add a Single Line Text field to your form.
 2. Open the field settings by clicking on the field and click on the “Advanced” tab.
 3. Check the “Save to Taxonomy” checkbox.
 4. Select the desired taxonomy from the drop down that appears.
 5. (optional) Check the “Enable Enhanced UI” checkbox to enable an awesome tag-input
    style UI (see screenshots).

Note: If the user inputs exising term names, the generated post will be assigned
these terms. If the user inputs term names that do not exist, these terms will be
added to the selected taxonomy and the generated post will also be assigned these
terms.

#### How to set a parent post with the drop down field

When populating a Drop Down field with a post type, you may wish to set the selected
post as the parent post for the generated post.

 1. Add A Drop Down field to your form.
 2. Click on the field to open the field settings. Then click on the “Advanced” tab.
 3. Check the “Populate with Post Type” checkbox.
 4. Select the desired post type from the drop down that appears. Be sure to select
    the **same post type** for which the post is being generated.

## 屏幕截图

 * [[
 * Frontend: Example of mapping to a custom post type and multiple taxonomies
 * [[
 * Frontend: Example of hierarchical taxonomy support
 * [[
 * Setting: Mapping to a custom post type
 * [[
 * Setting: Mapping a field to a custom taxonomy
 * [[
 * Setting: Assigning generated post to selected parent post
 * [[
 * Frontend: Example of Single Line Text field with Enhanced UI enabled
 * [[
 * Setting: Mapping a Single Line Text field to a taxonomy (and enabling Enhanced
   UI)

## 安装

 1. Upload the plugin folder ‘gravity-forms-custom-post-types’ to your `/wp-content/
    plugins/` folder
 2. 通过WordPress的“插件”菜单激活插件
 3. Make sure you also have Gravity Forms activated.

## 常见问题

### Does this plugin rely on anything?

Yes, you need to install the [Gravity Forms plugin](http://gwiz.io/gravityforms)
for this plugin to work.

### How do I map a form to a custom post type?

 1. Add a Post Title field to your form and click on it to open the field settings.
 2. Below the “Description” field setting, you will find the “Post Type” setting.
 3. Select the desired post type from the drop down (default is “Posts”).

### How do I link a field to a custom taxonomy?

 1. Add the desired field to which the custom taxonomy should be mapped. Drop Down,
    Multi Select, Radio Buttons and Checkboxes fields are current supported.
 2. Open the field settings by clicking on the field and click on the “Advanced” tab.
 3. Check the “Populate with a Taxonomy” checkbox.
 4. Select the desired taxonomy from the drop down that appears.

### How do I link the saved post to taxonomies using a single line text field?

Single Line Text fields are a great way to allow users to select existing taxonomy
terms and to also add new terms.

 1. Add a Single Line Text field to your form.
 2. Open the field settings by clicking on the field and click on the “Advanced” tab.
 3. Check the “Save to Taxonomy” checkbox.
 4. Select the desired taxonomy from the drop down that appears.
 5. (optional) Check the “Enable Enhanced UI” checkbox to enable an awesome tag-input
    style UI (see screenshots).

Note: If the user inputs exising term names, the generated post will be assigned
these terms. If the user inputs term names that do not exist, these terms will be
added to the selected taxonomy and the generated post will also be assigned these
terms.

### How do I set a parent post with the drop down field?

When populating a Drop Down field with a post type, you may wish to set the selected
post as the parent post for the generated post.

 1. Add A Drop Down field to your form.
 2. Click on the field to open the field settings. Then click on the “Advanced” tab.
 3. Check the “Populate with Post Type” checkbox.
 4. Select the desired post type from the drop down that appears. Be sure to select
    the **same post type** for which the post is being generated.

## 评价

![](https://secure.gravatar.com/avatar/92b9d60d95b21df786c5d22854734577c84f858c6650f3684c5e81acb53290a4?
s=60&d=retro&r=g)

### 󠀁[It works well and the support is great](https://wordpress.org/support/topic/it-works-well-and-the-support-is-great/)󠁿

 [helenxmas](https://profiles.wordpress.org/helenxmas/) 2021 年 11 月 9 日

I tried this plugin to make a date on my form display a certain way in notifications;
this was to save the client having to look at a calendar every time he received 
a booking to see what day of the week it was. Handy if you don’t have next year’s
calendar. At first it didn’t work but I asked support and their help was so thorough,
from numerous replies to my emails, to investigating the issue on the website. I
got a satisfactory resolution and the support team got it working. Good customer
support makes all the difference so I definitely give Gravity Wiz the thumbs up!

![](https://secure.gravatar.com/avatar/4130c260bf9888e3c635871cee069ae2b0efb9edbee919c660ef24fc2fed4249?
s=60&d=retro&r=g)

### 󠀁[Great Plugin](https://wordpress.org/support/topic/great-plugin-31933/)󠁿

 [linda83](https://profiles.wordpress.org/linda83/) 2021 年 8 月 26 日

Using Gravity Forms for several years now, I have been able to save time and create
great forms. With simple features that can be used in many ways as well as integrations,
it’s a plugin worth trying out!

![](https://secure.gravatar.com/avatar/b732c6ac4b931013edefd032b79b3f8fab42fccea7366f9dba6c09b892bd51d1?
s=60&d=retro&r=g)

### 󠀁[Not working anymore](https://wordpress.org/support/topic/it-works-fine-with-wp-5-0/)󠁿

 [Lucas](https://profiles.wordpress.org/luquerias/) 2021 年 5 月 14 日

Since the last update things do not work anymore…

![](https://secure.gravatar.com/avatar/91d3a4a2a1155272fb627ca3c00f1b62f90a11069c78afbfe78802f1c8c2244d?
s=60&d=retro&r=g)

### 󠀁[One of my favourite plugins](https://wordpress.org/support/topic/one-of-my-favourite-plugins-13/)󠁿

 [oae1980](https://profiles.wordpress.org/oae1980/) 2021 年 5 月 7 日

Love this plugin, used it so many times. The last time I used it was for custom 
registration\login and Stripe payment integration and it worked out great.

![](https://secure.gravatar.com/avatar/975bb5fbe919a36bc38076c202666e0e2de395b4e7d9cac1f42586fad256db26?
s=60&d=retro&r=g)

### 󠀁[Excellent Plugin](https://wordpress.org/support/topic/excellent-plugin-7029/)󠁿

 [charliewilliams2383](https://profiles.wordpress.org/charliewilliams2383/) 2021
年 5 月 6 日

It’s simple, low drag, and does everything you need. Perfect user case is you want
to create a gravity form that writes to any custom post you have made, along as 
writing to the CPT’s categories, tags, etc. I use stover the organic gravity form
advanced post type add-on. Way better.

![](https://secure.gravatar.com/avatar/9873c549cd703fea2f74b359b66b9f46532b0e2b99bc11a3179395fd2afbd1d6?
s=60&d=retro&r=g)

### 󠀁[Auto-generating parent-child – without coding](https://wordpress.org/support/topic/auto-generating-parent-child-without-coding/)󠁿

 [dkrahl](https://profiles.wordpress.org/dkrahl/) 2020 年 9 月 6 日

Works without any issues. Saved me a lot of time and headaches auto-generating parent-
child relationship for custom post types and front end form submissions saved as
children. I needed maybe one hour to get it working as expected, more user case 
demos may have helped to better understand settings. Thank you again for this plugin.

 [ 阅读所有46条评价 ](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/reviews/)

## 贡献者及开发者

「Gravity Forms + Custom Post Types」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Dave from Gravity Wiz ](https://profiles.wordpress.org/spivurno/)
 *   [ claygriffiths ](https://profiles.wordpress.org/claygriffiths/)
 *   [ bradvin ](https://profiles.wordpress.org/bradvin/)
 *   [ Travis Smith ](https://profiles.wordpress.org/wpsmith/)

[帮助将「Gravity Forms + Custom Post Types」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/gravity-forms-custom-post-types)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/gravity-forms-custom-post-types/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/gravity-forms-custom-post-types/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/gravity-forms-custom-post-types/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/gravity-forms-custom-post-types/)。

## 更新日志

#### 3.1.31

 * Fixed readme.txt formatting for WordPress.org plugin directory.

#### 3.1.30

 * Fixed a PHP notice that occurred when field had no choices set.
 * Updated “Tested up to” tag to 6.9.1.

#### 3.1.29

 * Fixed PHP warning.

#### 3.1.28

 * Fixed potential PHP warning.
 * Updated “Tested up to” to WordPress 6.0.2.

#### 3.1.27

 * Fixed an issue where term names were not displayed for multi-value fields like
   Checkboxes and Multi-selects in the Entry List and Entry Detail views.

#### 3.1.26

 * Updated “Tested up to” to WordPress 5.9.

#### 3.1.25

 * Fixed PHP 8 deprecation notices about required parameters after optional parameters.

#### 3.1.24

 * Fixed an issue where taxonomy terms may be saved as choices on non-choice based
   fields.

#### 3.1.23

 * Fixed a compatibility issue with GF 2.5.5.4+ which converted default values to
   the term ID when displayed/stored.
 * Added taxonomy name (in addition to label) to Taxonomy dropdowns. Credit: @grapplerulrich

#### 3.1.22

 * Added post name (in addition to label) to Post Type dropdowns in Form Editor.
   Credit: @grapplerulrich
 * Fixed issue where `gfcpt_taxonomy_args` filter was not used for non-hierarchical
   terms. Credit: @grapplerulrich

#### 3.1.21

 * Fixed a compatibility issue with Gravity Forms 2.5 and Enhanced UI.

#### 3.1.20

 * Fixed PHP notice on Gravity Forms Coupons Add-On page.
 * Fixed PHP warning when populating taxonomies.
 * Updated formatting of PHP files in plugin to better conform to the WordPress 
   Coding Standards.

#### 3.1.19

 * Bumped plugin version.

#### 3.1.18

 * Fixed issue with “Save To Taxonomy” setting not properly saving the entered taxonomy.

#### 3.1.17

 * Readme updates.

#### 3.1.16

 * Readme updates.

#### 3.1.15

 * Fixed issue when exporting taxonomy-and-post-type-populated Checkbox fields.
 * Updated how scripts are enqueued.
 * Tested with 5.5.1.

#### 3.1.14

 * Updated how taxonomy enhanced UI script and data were loaded.

#### 3.1.13

 * Added ‘gfcpt_hierarchical_display’ filter to allow filtering whether to display
   choices hierarchically.

#### 3.1.12

 * Fixed issue with GF 2.3 where taxonomies were not correctly saved on submission.

#### 3.1.11

 * Fixed issue where dynamic placeholder was duplicated in some instances.

#### 3.1.10

 * Fixed issue where dynamic placeholder was added even when default placeholder
   was specified.

#### 3.1.9

 * Added support for displaying Post Title on entry list, detail and export for 
   fields populated with a post type.
 * Updated default sort order for pages to “menu_order”.

#### 3.1.8

 * Fixed issue mapping taxonomies for Single Line Text fiela and Multi Select fields.
   Thanks, Cameron!

#### 3.1.7

 * Added support for displaying term label on Entry List and Export views (rather
   than term ID; does not work with Checkbox and Multi-select on Entry List).

#### 3.1.6

 * Added support for displaying term label on Entry Detail view (rather than term
   ID)

#### 3.1.5

 * Fixed issue with populating Drop Down & Multi Selects
 * Fixed issue when saving Multi Select taxonomies

#### 3.1.4

 * Updated plugin header information.

#### 3.1.3

 * Fixed compatibility issue with Gravity Forms: Post Updates plugin; custom taxonomies
   were not being saved.

#### 3.1.2

 * Fixed issue where setting first option was not possible due to typo in property
   name
 * Updated how GFCPTAddon::get_base_path() method retrieves the base path

#### 3.1.1

 * Updated all calls to get_post_types() to use plugin-specific version which applies
   the ‘gfcpt_post_type_args’ filter. Props: mgratch
 * Updated all calls to get_taxonomies() to use plugin-specific version which applies
   the ‘gfcpt_tax_args’ filter. Props: mgratch
 * Fixed issue where missing script dependency caused tag-style entry of terms was
   not working. Props: mgratch
 * Fixed issue where plugin’s registration of GF preview styles was overwriting 
   all other preview styles
 * Fixed issue where taxonomies were not saved for delayed payment entries
 * Updated Tag init JS to be bound to the ‘gform_post_render’ JS event which better
   supports other plugin integrations
 * Updated Tag init JS file to be loaded in the footer
 * Added ‘gfcpt_get_posts_args’ filter to allow modifying the posts that are populated
   into a field

#### 3.1

 * Added “gfcpt_taxonomy_args” filter to allow modifying the arguments used to retrieve
   taxonomy terms
 * Added “gfcpt_post_type_args” filter to allow modifying the arguments used to 
   retrive post types for selection in field settings
 * Updated verbiage throughout plugin and readme.txt file
 * Updated minimum required version of Gravity Forms to 1.9.3
 * Updated “Save As Post Type” to be “Post Type” and moved location to standard 
   settings tab
 * Updated jQuery UI enqueue to use version from WP core
 * Updated GFCPTAddonBase::load_taxonomy_hierarchical() method to support only displaying
   children of a parent term (requires “gfcpt_taxonomy_args” filter)
 * Fixed styling issues with Enhanced-UI-enabled Single Line Text fields
 * Fixed notice where get_base_path() was called statically by changing function
   to be static
 * Fixed issue where taxonomy select on Drop Down field settings would not populate
   the selected taxonomy correctly
 * Fixed issue with GF 1.9 where indirect modfiication of $field[‘inputs’] property
   had no effect; resolves issues using custom taxonomies with Checkbox fields

#### 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.

## 额外信息

 *  版本 **3.1.31**
 *  最后更新：**2 天前**
 *  活跃安装数量 **10,000+**
 *  WordPress 版本 ** 3.0.1 或更高版本 **
 *  已测试的最高版本为 **6.9.4**
 *  PHP 版本 ** 5.6 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/gravity-forms-custom-post-types/)
 * 标签
 * [custom post types](https://cn.wordpress.org/plugins/tags/custom-post-types/)
   [custom taxonomy](https://cn.wordpress.org/plugins/tags/custom-taxonomy/)[gravity forms](https://cn.wordpress.org/plugins/tags/gravity-forms/)
   [taxonomy](https://cn.wordpress.org/plugins/tags/taxonomy/)
 *  [高级视图](https://cn.wordpress.org/plugins/gravity-forms-custom-post-types/advanced/)

## 评级

 4.4 星（最高 5 星）。

 *  [  37 条 5 星评价     ](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/reviews/?filter=5)
 *  [  2 条 4 星评价     ](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/reviews/?filter=4)
 *  [  1 条 3 星评价     ](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/reviews/?filter=2)
 *  [  6 条 1 星评价     ](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/reviews/)

## 贡献者

 *   [ Dave from Gravity Wiz ](https://profiles.wordpress.org/spivurno/)
 *   [ claygriffiths ](https://profiles.wordpress.org/claygriffiths/)
 *   [ bradvin ](https://profiles.wordpress.org/bradvin/)
 *   [ Travis Smith ](https://profiles.wordpress.org/wpsmith/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://gravitywiz.com/)