Skip to content

Commit

Permalink
Trigger notifications after GF cache cleared
Browse files Browse the repository at this point in the history
The products cache doesn't get cleared until priority 10 of `gravityview/edit_entry/after_update`, which is well after when the `gform_after_update_entry` action was fired. This led to notifications (and in my case PDFs) that had out-of-date product details. This change will ensure the notifications aren't fired until after the products cache is cleared.
  • Loading branch information
jakejackson1 authored Jan 11, 2018
1 parent 6d0762c commit d453b30
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gravityview-enable-notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* Plugin Name: GravityView - Enable Gravity Forms Notifications
* Plugin URI: http://gravityview.co/
* Description: Enable Gravity Forms notifications when an entry is edited in GravityView.
* Version: 1.0
* Version: 1.0.1
* Author: Katz Web Services, Inc.
* Author URI: http://www.katzwebservices.com
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

add_action( 'gform_after_update_entry', 'gravityview_enable_gf_notifications_after_update', 10, 2 );
add_action( 'gravityview/edit_entry/after_update', 'gravityview_enable_gf_notifications_after_update', 20, 2 );

/**
* Triggers Gravity Forms notifications engine when entry is updated (admin or frontend)
Expand Down Expand Up @@ -47,4 +47,4 @@ function gravityview_enable_gf_notifications_after_api_update_entry( $entry, $or
$form = GFAPI::get_form( $entry['form_id'] );

GFCommon::send_form_submission_notifications( $form, $entry );
}
}

0 comments on commit d453b30

Please sign in to comment.