Changeset 2718757
- Timestamp:
- 05/05/2022 07:47:13 PM (4 years ago)
- Location:
- gravity-forms-custom-post-types
- Files:
-
- 6 edited
- 1 copied
-
tags/3.1.27 (copied) (copied from gravity-forms-custom-post-types/trunk)
-
tags/3.1.27/gfcptaddon.php (modified) (2 diffs)
-
tags/3.1.27/gfcptaddonbase.php (modified) (3 diffs)
-
tags/3.1.27/readme.txt (modified) (1 diff)
-
trunk/gfcptaddon.php (modified) (2 diffs)
-
trunk/gfcptaddonbase.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
gravity-forms-custom-post-types/tags/3.1.27/gfcptaddon.php
r2665012 r2718757 4 4 Plugin URI: https://gravitywiz.com/ 5 5 Description: Map your Gravity-Forms-generated posts to a custom post type and/or custom taxonomies. 6 Version: 3.1.2 66 Version: 3.1.27 7 7 Author: Gravity Wiz 8 8 Author URI: https://gravitywiz.com/ … … 17 17 private static $name = 'Gravity Forms + Custom Post Types'; 18 18 private static $slug = 'GFCPTAddon'; 19 private static $version = '3.1.2 6';19 private static $version = '3.1.27'; 20 20 private static $min_gravityforms_version = '1.9.3'; 21 21 -
gravity-forms-custom-post-types/tags/3.1.27/gfcptaddonbase.php
r2588045 r2718757 442 442 } 443 443 444 if ( ! array_key_exists( "errors", $terms ) ) {444 if ( ! isset( $terms->errors ) ) { 445 445 foreach ( $terms as $term ) { 446 446 $choices[] = array( 'value' => $term->term_id, 'text' => $term->name ); … … 593 593 } 594 594 595 /** 596 * @param $value 597 * @param \GF_Field $field 598 * @param $entry 599 * @param $form 600 * 601 * @return mixed|string 602 */ 595 603 function display_term_name_on_entry_detail( $value, $field, $entry, $form ) { 604 605 if ( $field->populateTaxonomy && in_array( $field->get_input_type(), array( 'checkbox', 'multiselect' ) ) ) { 606 $values = GFFormsModel::get_lead_field_value( $entry, $field ); 607 if ( $field->get_input_type() === 'multiselect' ) { 608 $values = json_decode( $values ); 609 } 610 foreach ( $values as &$_value ) { 611 $_value = $this->get_term_name( $_value, $field ); 612 } 613 return $field->get_value_entry_detail( $values ); 614 } 615 596 616 return $this->get_term_name( $value, $field ); 597 617 } 598 618 599 function display_term_name_on_entry_list( $value, $form_id, $field_id ) {619 function display_term_name_on_entry_list( $value, $form_id, $field_id, $entry = null ) { 600 620 601 621 if ( is_numeric( $field_id ) ) { 602 $f ield = GFFormsModel::get_field( GFAPI::get_form( $form_id ), $field_id );603 $value = $this-> get_term_name( $value, $field);622 $form = GFAPI::get_form( $form_id ); 623 $value = $this->display_term_name_on_entry_detail( $value, GFAPI::get_field( $form, $field_id ), $entry, $form ); 604 624 } 605 625 … … 607 627 } 608 628 609 function display_term_name_on_export( $value, $form_id, $field_id ) {610 return $this->display_term_name_on_entry_list( $value, $form_id, $field_id );629 function display_term_name_on_export( $value, $form_id, $field_id, $entry = null ) { 630 return $this->display_term_name_on_entry_list( $value, $form_id, $field_id, $entry ); 611 631 } 612 632 -
gravity-forms-custom-post-types/tags/3.1.27/readme.txt
r2665012 r2718757 81 81 82 82 == Changelog == 83 84 = 3.1.27 = 85 * 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. 83 86 84 87 = 3.1.26 = -
gravity-forms-custom-post-types/trunk/gfcptaddon.php
r2665012 r2718757 4 4 Plugin URI: https://gravitywiz.com/ 5 5 Description: Map your Gravity-Forms-generated posts to a custom post type and/or custom taxonomies. 6 Version: 3.1.2 66 Version: 3.1.27 7 7 Author: Gravity Wiz 8 8 Author URI: https://gravitywiz.com/ … … 17 17 private static $name = 'Gravity Forms + Custom Post Types'; 18 18 private static $slug = 'GFCPTAddon'; 19 private static $version = '3.1.2 6';19 private static $version = '3.1.27'; 20 20 private static $min_gravityforms_version = '1.9.3'; 21 21 -
gravity-forms-custom-post-types/trunk/gfcptaddonbase.php
r2588045 r2718757 442 442 } 443 443 444 if ( ! array_key_exists( "errors", $terms ) ) {444 if ( ! isset( $terms->errors ) ) { 445 445 foreach ( $terms as $term ) { 446 446 $choices[] = array( 'value' => $term->term_id, 'text' => $term->name ); … … 593 593 } 594 594 595 /** 596 * @param $value 597 * @param \GF_Field $field 598 * @param $entry 599 * @param $form 600 * 601 * @return mixed|string 602 */ 595 603 function display_term_name_on_entry_detail( $value, $field, $entry, $form ) { 604 605 if ( $field->populateTaxonomy && in_array( $field->get_input_type(), array( 'checkbox', 'multiselect' ) ) ) { 606 $values = GFFormsModel::get_lead_field_value( $entry, $field ); 607 if ( $field->get_input_type() === 'multiselect' ) { 608 $values = json_decode( $values ); 609 } 610 foreach ( $values as &$_value ) { 611 $_value = $this->get_term_name( $_value, $field ); 612 } 613 return $field->get_value_entry_detail( $values ); 614 } 615 596 616 return $this->get_term_name( $value, $field ); 597 617 } 598 618 599 function display_term_name_on_entry_list( $value, $form_id, $field_id ) {619 function display_term_name_on_entry_list( $value, $form_id, $field_id, $entry = null ) { 600 620 601 621 if ( is_numeric( $field_id ) ) { 602 $f ield = GFFormsModel::get_field( GFAPI::get_form( $form_id ), $field_id );603 $value = $this-> get_term_name( $value, $field);622 $form = GFAPI::get_form( $form_id ); 623 $value = $this->display_term_name_on_entry_detail( $value, GFAPI::get_field( $form, $field_id ), $entry, $form ); 604 624 } 605 625 … … 607 627 } 608 628 609 function display_term_name_on_export( $value, $form_id, $field_id ) {610 return $this->display_term_name_on_entry_list( $value, $form_id, $field_id );629 function display_term_name_on_export( $value, $form_id, $field_id, $entry = null ) { 630 return $this->display_term_name_on_entry_list( $value, $form_id, $field_id, $entry ); 611 631 } 612 632 -
gravity-forms-custom-post-types/trunk/readme.txt
r2665012 r2718757 81 81 82 82 == Changelog == 83 84 = 3.1.27 = 85 * 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. 83 86 84 87 = 3.1.26 =
Note: See TracChangeset
for help on using the changeset viewer.