Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions includes/Pods_GF.php
Original file line number Diff line number Diff line change
Expand Up @@ -3211,7 +3211,7 @@ public static function gf_field_input_read_only( $input_html, $field, $value, $l
if ( isset( $field['pageNumber'] ) && 0 < (int) $field['pageNumber'] && $last_page !== (int) $field['pageNumber'] ) {
self::$actioned[$form_id][__FUNCTION__] = (int) $field['pageNumber'];

$page_header = '<h3 class="gf-page-title">' . $form['pagination']['pages'][( (int) $field['pageNumber'] - 1 )] . '</h3>';
$page_header = '<h3 class="gf-page-title">' . wp_kses_post( $form['pagination']['pages'][( (int) $field['pageNumber'] - 1 )] ) . '</h3>';
}

if ( 'html' == $field_type ) {
Expand Down Expand Up @@ -3697,7 +3697,7 @@ public static function get_gf_field_value( $value, $params ) {
$value = $value_check;
}
} elseif ( 'us_state' === $pick_object ) {
$value = $gf_field->get_us_state_code( $value );
$value_check = $gf_field->get_us_state_code( $value );

if ( $value_check ) {
$value = $value_check;
Expand Down Expand Up @@ -4281,7 +4281,7 @@ public function _gf_validation( $validation_result ) {
return $validation_result;
}

if ( empty( $this->options['gf_to_pods_priority'] ) || 'validation' == $this->options['gf_to_pods_priority'] ) {
if ( empty( $this->options['gf_to_pods_priority'] ) || 'validation' === $this->options['gf_to_pods_priority'] ) {
try {
$this->_gf_to_pods_handler( $form );
}
Expand Down Expand Up @@ -4574,7 +4574,7 @@ public function _gf_after_submission( $entry, $form ) {
}

// Alternative gf_to_pods handling
if ( ! empty( $this->options['gf_to_pods_priority'] ) && 'submission' == $this->options['gf_to_pods_priority'] ) {
if ( ! empty( $this->options['gf_to_pods_priority'] ) && 'submission' === $this->options['gf_to_pods_priority'] ) {
try {
$this->options['entry'] = $entry;

Expand Down
10 changes: 6 additions & 4 deletions includes/Pods_GF_Addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,9 @@ public function process_feed( $feed, $entry, $form ) {
// Ensure other custom Pods GF submission handling does not duplicate.
remove_action( 'gform_after_submission_' . $form['id'], [ $pods_gf, '_gf_after_submission' ] );

$id = $pods_gf->_gf_to_pods_handler( $form, $entry );
$pods_gf->_gf_after_submission( $entry, $form );

$id = $pods_gf->options['pod_item_id'];

// Set post_id if we have it.
if ( 'post_type' === $pods_gf->pod->pod_data['type'] ) {
Expand Down Expand Up @@ -1197,9 +1199,9 @@ public function setup_pods_gf( $form, $feed ) {
$options = array(
// array ( 'gf_field_id' => 'pod_field_name' )
'fields' => $fields,
'update_pod_item' => (int) pods_v( 'update_pod_item', $feed['meta'], 0 ),
'markdown' => (int) pods_v( 'enable_markdown', $feed['meta'], 0 ),
'auto_delete' => (int) pods_v( 'delete_entry', $feed['meta'], 0 ),
'update_pod_item' => 1 === (int) pods_v( 'update_pod_item', $feed['meta'], 0 ),
'markdown' => 1 === (int) pods_v( 'enable_markdown', $feed['meta'], 0 ),
'auto_delete' => 1 === (int) pods_v( 'delete_entry', $feed['meta'], 0 ),
'gf_to_pods_priority' => 'submission',
);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pods-gravity-forms",
"version": "1.5.0",
"version": "1.5.1",
"description": "PIntegration with Gravity Forms; Provides a UI for mapping a Form's submissions into a Pod.",
"author": "Pods Foundation, Inc",
"homepage": "https://pods.io/",
Expand Down
33 changes: 18 additions & 15 deletions pods-gravity-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
Plugin URI: https://pods.io/
Requires Plugins: pods
Description: Integration with Gravity Forms (https://www.gravityforms.com/); Provides a UI for mapping a Form's submissions into a Pod
Version: 1.5.0
Version: 1.5.1
Author: Pods Framework Team
Author URI: https://pods.io/about/
Text Domain: pods-gravity-forms
GitHub Plugin URI: https://github.com/pods-framework/pods-gravity-forms

Copyright 2013-2024 Pods Foundation, Inc (email : contact@podsfoundation.org)
Copyright 2013-2025 Pods Foundation, Inc (email : contact@podsfoundation.org)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -31,7 +31,7 @@
* @package Pods\Gravity Forms
*/

define( 'PODS_GF_VERSION', '1.5.0' );
define( 'PODS_GF_VERSION', '1.5.1' );
define( 'PODS_GF_FILE', __FILE__ );
define( 'PODS_GF_DIR', plugin_dir_path( PODS_GF_FILE ) );
define( 'PODS_GF_URL', plugin_dir_url( PODS_GF_FILE ) );
Expand Down Expand Up @@ -80,7 +80,7 @@ function pods_gf_include_gf_addon() {
*/
function pods_gf_init() {

if ( ! function_exists( 'pods' ) || ! class_exists( 'GFCommon' ) ) {
if ( ! function_exists( 'pods' ) || ! class_exists( 'GFCommon' ) || has_action( 'wp', 'pods_gf_ui_init' ) ) {
return false;
}

Expand All @@ -98,6 +98,8 @@ function pods_gf_init() {
add_action( 'wp_ajax_nopriv_pods_gf_save_for_later', 'pods_gf_save_for_later_ajax' );
}

return true;

}

add_action( 'init', 'pods_gf_init' );
Expand Down Expand Up @@ -126,12 +128,12 @@ function pods_gf_admin_nag() {
*/
function pods_gf_add_related_objects() {

PodsField_Pick::$related_objects['gf-forms'] = array(
PodsField_Pick::$related_objects['gf-forms'] = [
'label' => __( 'Forms', 'pods' ),
'group' => __( 'Gravity Forms', 'pods' ),
'simple' => true,
'data_callback' => 'pods_gf_add_related_objects_forms',
);
];

}

Expand All @@ -152,7 +154,7 @@ function pods_gf_add_related_objects() {
*/
function pods_gf_add_related_objects_forms( $name = null, $value = null, $options = null, $pod = null, $id = null ) {

$data = array();
$data = [];

// Get all forms.
$forms = RGFormsModel::get_forms( null, 'title' );
Expand All @@ -176,35 +178,36 @@ function pods_gf_add_related_objects_forms( $name = null, $value = null, $option
*/
function pods_gravity_forms_freemius() {
try {
fs_dynamic_init( array(
fs_dynamic_init( [
'id' => '5754',
'slug' => 'pods-gravity-forms',
'type' => 'plugin',
'public_key' => 'pk_1aaaee6bf8963f2077405e84f2ac5',
'is_premium' => false,
'has_paid_plans' => false,
'is_org_compliant' => true,
'parent' => array(
'parent' => [
'id' => '5347',
'slug' => 'pods',
'public_key' => 'pk_737105490825babae220297e18920',
'name' => 'Pods',
),
'menu' => array(
],
'menu' => [
'slug' => 'pods-settings',
'contact' => false,
'support' => false,
'affiliation' => false,
'account' => true,
'pricing' => false,
'addons' => true,
'parent' => array(
'parent' => [
'slug' => 'pods',
),
),
) );
],
],
] );
} catch ( \Exception $exception ) {
return;
}
}

add_action( 'pods_freemius_init', 'pods_gravity_forms_freemius' );
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Contributors: sc0ttkclark, jimtrue, naomicbush, gravityplus
Donate link: https://friends.pods.io/
Tags: pods, gravity forms, form mapping
Requires at least: 6.0
Tested up to: 6.5
Tested up to: 6.8
Requires PHP: 7.2
Stable tag: 1.5.0
Stable tag: 1.5.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -113,6 +113,11 @@ function my_column_row_override( $row, $columns, $form, $gf_field, $options, $re

== Changelog ==

= 1.5.1 - March 29th, 2024 =

* Fixed: Resolved issue with auto-delete option when using Pods feeds. (@sc0ttkclark)
* Tested against WP 6.8. (@sc0ttkclark)

= 1.5.0 - March 29th, 2024 =

* New requirements that match Pods: WP 6.0+, PHP 7.2+, and Pods 3.0+ to prep for Pods Gravity Forms 2.0 (@sc0ttkclark)
Expand Down
Loading