Gravity Forms + Custom Post Types - Version 3.1.24

Version Description

  • Fixed an issue where taxonomy terms may be saved as choices on non-choice based fields.
Download this release

Release Info

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

Code changes from version 3.1.23 to 3.1.24

Files changed (3) hide show
  1. gfcptaddon.php +2 -2
  2. gfcptaddonbase.php +7 -0
  3. readme.txt +3 -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.23
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.23';
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.24
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.24';
20
  private static $min_gravityforms_version = '1.9.3';
21
 
22
  //Plugin starting point. Will load appropriate files
gfcptaddonbase.php CHANGED
@@ -371,6 +371,13 @@ if ( ! class_exists( 'GFCPTAddonBase' ) ) {
371
  return;
372
  }
373
 
 
 
 
 
 
 
 
374
  $first_choice = rgars( $field, 'choices/0/text' );
375
  $field['choices'] = $this->load_taxonomy_choices( $taxonomy, $field['type'], $first_choice, $field );
376
  $field->enableChoiceValue = true;
371
  return;
372
  }
373
 
374
+ // Choices check is not sufficient in cases where choices were accidentally saved to non-choice fields.
375
+ if ( ! in_array( $field->get_input_type(), array( 'select', 'multiselect', 'radio', 'checkbox' ), true ) ) {
376
+ // This clears any choices stored on non-choice based fields due to an earlier bug in GF+CPT. See HS#25737
377
+ $field['choices'] = '';
378
+ return;
379
+ }
380
+
381
  $first_choice = rgars( $field, 'choices/0/text' );
382
  $field['choices'] = $this->load_taxonomy_choices( $taxonomy, $field['type'], $first_choice, $field );
383
  $field->enableChoiceValue = true;
readme.txt CHANGED
@@ -81,6 +81,9 @@ When populating a Drop Down field with a post type, you may wish to set the sele
81
 
82
  == Changelog ==
83
 
 
 
 
84
  = 3.1.23 =
85
  * Fixed a compatibility issue with GF 2.5.5.4+ which converted default values to the term ID when displayed/stored.
86
  * Added taxonomy name (in addition to label) to Taxonomy dropdowns. Credit: @grapplerulrich
81
 
82
  == Changelog ==
83
 
84
+ = 3.1.24 =
85
+ * Fixed an issue where taxonomy terms may be saved as choices on non-choice based fields.
86
+
87
  = 3.1.23 =
88
  * Fixed a compatibility issue with GF 2.5.5.4+ which converted default values to the term ID when displayed/stored.
89
  * Added taxonomy name (in addition to label) to Taxonomy dropdowns. Credit: @grapplerulrich