Gravity Forms + Custom Post Types - Version 3.1.22

Version Description

  • 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
Download this release

Release Info

Developer claygriffiths
Plugin Icon wp plugin Gravity Forms + Custom Post Types
Version 3.1.22
Comparing to
See all releases

Code changes from version 3.1.21 to 3.1.22

Files changed (4) hide show
  1. gfcptaddon.php +2 -2
  2. gfcptaddon_1-5.php +2 -2
  3. gfcptaddonbase.php +7 -1
  4. readme.txt +5 -0
gfcptaddon.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Gravity Forms + Custom Post Types
4
  Plugin URI: https://gravitywiz.com/
5
  Description: Map your Gravity-Forms-generated posts to a custom post type and/or custom taxonomies.
6
- Version: 3.1.21
7
  Author: Gravity Wiz
8
  Author URI: https://gravitywiz.com/
9
  License: GPL2
@@ -16,7 +16,7 @@ class GFCPTAddon {
16
 
17
  private static $name = 'Gravity Forms + Custom Post Types';
18
  private static $slug = 'GFCPTAddon';
19
- private static $version = '3.1.21';
20
  private static $min_gravityforms_version = '1.9.3';
21
 
22
  //Plugin starting point. Will load appropriate files
3
  Plugin Name: Gravity Forms + Custom Post Types
4
  Plugin URI: https://gravitywiz.com/
5
  Description: Map your Gravity-Forms-generated posts to a custom post type and/or custom taxonomies.
6
+ Version: 3.1.22
7
  Author: Gravity Wiz
8
  Author URI: https://gravitywiz.com/
9
  License: GPL2
16
 
17
  private static $name = 'Gravity Forms + Custom Post Types';
18
  private static $slug = 'GFCPTAddon';
19
+ private static $version = '3.1.22';
20
  private static $min_gravityforms_version = '1.9.3';
21
 
22
  //Plugin starting point. Will load appropriate files
gfcptaddon_1-5.php CHANGED
@@ -101,7 +101,7 @@ if ( ! class_exists( 'GFCPTAddon1_5' ) ) {
101
  <select id="field_populate_custom_post_type"
102
  onchange="SetFieldProperty('saveAsCPT', jQuery(this).val());">
103
  <?php foreach ( $this->get_post_types( $form_id ) as $post_type ) : ?>
104
- <option value="<?php echo $post_type->name; ?>" <?php selected( 'post', $post_type->name ); ?>><?php echo $post_type->label; ?></option>
105
  <?php endforeach; ?>
106
  </select>
107
  </li>
@@ -144,7 +144,7 @@ if ( ! class_exists( 'GFCPTAddon1_5' ) ) {
144
  <?php
145
  foreach ( $this->get_post_types( $form_id ) as $post_type ) :
146
  ?>
147
- <option value="<?php echo $post_type->name; ?>"><?php echo $post_type->label; ?></option>
148
  <?php endforeach; ?>
149
  </select>
150
  <input type="checkbox" class="check_parent"
101
  <select id="field_populate_custom_post_type"
102
  onchange="SetFieldProperty('saveAsCPT', jQuery(this).val());">
103
  <?php foreach ( $this->get_post_types( $form_id ) as $post_type ) : ?>
104
+ <option value="<?php echo $post_type->name; ?>" <?php selected( 'post', $post_type->name ); ?>><?php echo $post_type->label . ' (' . $post_type->name . ')'; ?></option>
105
  <?php endforeach; ?>
106
  </select>
107
  </li>
144
  <?php
145
  foreach ( $this->get_post_types( $form_id ) as $post_type ) :
146
  ?>
147
+ <option value="<?php echo $post_type->name; ?>"><?php echo $post_type->label . ' (' . $post_type->name . ')'; ?></option>
148
  <?php endforeach; ?>
149
  </select>
150
  <input type="checkbox" class="check_parent"
gfcptaddonbase.php CHANGED
@@ -419,7 +419,13 @@ if ( ! class_exists( 'GFCPTAddonBase' ) ) {
419
  }
420
 
421
  } else {
422
- $terms = get_terms( $taxonomy, 'orderby=name&hide_empty=0' );
 
 
 
 
 
 
423
  }
424
 
425
  if ( ! array_key_exists( "errors", $terms ) ) {
419
  }
420
 
421
  } else {
422
+ $args = gf_apply_filters( 'gfcpt_taxonomy_args', array( $field->formId, $field->id ), array(
423
+ 'taxonomy' => $taxonomy,
424
+ 'orderby' => 'name',
425
+ 'hide_empty' => 0
426
+ ), $field );
427
+
428
+ $terms = get_terms( $args );
429
  }
430
 
431
  if ( ! array_key_exists( "errors", $terms ) ) {
readme.txt CHANGED
@@ -81,6 +81,11 @@ When populating a Drop Down field with a post type, you may wish to set the sele
81
 
82
  == Changelog ==
83
 
 
 
 
 
 
84
  = 3.1.21 =
85
 
86
  * Fixed a compatibility issue with Gravity Forms 2.5 and Enhanced UI.
81
 
82
  == Changelog ==
83
 
84
+ = 3.1.22 =
85
+
86
+ * Added post name (in addition to label) to Post Type dropdowns in Form Editor. Credit: @grapplerulrich
87
+ * Fixed issue where `gfcpt_taxonomy_args` filter was not used for non-hierarchical terms. Credit: @grapplerulrich
88
+
89
  = 3.1.21 =
90
 
91
  * Fixed a compatibility issue with Gravity Forms 2.5 and Enhanced UI.