Title: Wrong notification on Post Update with Gravity Forms Post Updates plugin
Last modified: January 11, 2017

---

# Wrong notification on Post Update with Gravity Forms Post Updates plugin

 *  Resolved [KostasNi](https://wordpress.org/support/users/kostasni/)
 * (@kostasni)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/wrong-notification-on-post-update-with-gravity-forms-post-updates-plugin/)
 * I am using Gravity Forms to let (logged in) site users submit posts from the 
   front end. I’ve setup BNFW to send 2 “New Post Published” notifications when 
   a new post is submitted: one to the admin and one to the user. This works great.
 * I also use Gravity Forms and the Gravity Forms Post Updates plugin so that an
   admin can update these posts from the front end. I want to send a notification
   to the post submitter when their post has been updated by the admin so I’ve created
   a “Post Updated” notification. However when the post is edited on the front end,
   instead of the “Post Updated” notification, the 2 “New Post Published” notifications
   are sent instead.
 * When a post is updated using Gravity Forms and Gravity Forms Post Updates, the
   post’s post_status is first changed to “draft” and then to “publish” again, which
   triggers the “New Post Published” notifications.
 * Is there a way to check if the post_status was changed twice (publish->draft,
   draft->publish) and send the “Post Updated” instead of the “New Post Published”
   notification?
 * ps. This issue has been reported in the past: [Issue with Gravity Forms](https://wordpress.org/support/topic/issue-with-gravity-forms-1/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Jack – BNFW](https://wordpress.org/support/users/voltronik/)
 * (@voltronik)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/wrong-notification-on-post-update-with-gravity-forms-post-updates-plugin/#post-8641391)
 * Hi [@kostasni](https://wordpress.org/support/users/kostasni/),
    Thanks for your
   message.
 * Have you contacted the Gravity Forms Post Updates plugin author about this too?
   A two pronged approach might work well in resolving this, if possible.
 * Thanks,
    Jack
 *  Thread Starter [KostasNi](https://wordpress.org/support/users/kostasni/)
 * (@kostasni)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/wrong-notification-on-post-update-with-gravity-forms-post-updates-plugin/#post-8643797)
 * Thanks for getting back to me [@voltronik](https://wordpress.org/support/users/voltronik/).
 * Gravity Forms Post Updates doesn’t seem to be actively maintained or supported.
   I’ve posted a support topic there as well: [Unwanted Post Status change on update](https://wordpress.org/support/topic/unwanted-post-status-change-on-update/).
 *  Plugin Author [Jack – BNFW](https://wordpress.org/support/users/voltronik/)
 * (@voltronik)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/wrong-notification-on-post-update-with-gravity-forms-post-updates-plugin/#post-8645449)
 * Hi [@kostasni](https://wordpress.org/support/users/kostasni/),
    Ok. Let me know
   how it goes with the developer if he comes back to you.
 * In the meantime, have you considered editing the other plugin?
 * Thanks,
    Jack
 *  Thread Starter [KostasNi](https://wordpress.org/support/users/kostasni/)
 * (@kostasni)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/wrong-notification-on-post-update-with-gravity-forms-post-updates-plugin/#post-8665881)
 * Hi Jack,
    The problem ended up being not with the Gravity Forms: Post Updates
   plugin, but with the way Gravity Forms handles the post creation/update.
 * Specifically, GF changes the post’s post_status to draft
 *     ```
       // remove original post status and save it for later
       $post_status = $post_data['post_status'];
   
       // replace original post status with 'draft' so other plugins know this post is not fully populated yet
       $post_data['post_status'] = 'draft';
       ```
   
 * and then changes it back to whatever it was
 *     ```
       // update post status back to original status (if not draft)
       if ( $post_status != 'draft' ) {
           $post = is_object( $post ) ? $post : get_post( $post_id );
           $post->post_status = $post_status;
       } 
       ```
   
 * It was the second change, draft to publish, that triggered the draft_to_publish
   hook which Better Notification for WordPress uses.
 * To prevent the “New Post” notifications, you need to eliminate the draft to publish
   change.
 * I accomplished that by first changing the post_status to something other than
   publish (I used ’temp_status’) and then after GF does it’s thing, changing it
   back to publish. I also added a second post_update at the end to trigger the 
   publish_to_publish hook and send the “Post Updated” notification.
 * I hope this helps anyone who runs into the same issue in the future.
    -  This reply was modified 9 years, 4 months ago by [KostasNi](https://wordpress.org/support/users/kostasni/).
      Reason: formatting
 *  Plugin Author [Jack – BNFW](https://wordpress.org/support/users/voltronik/)
 * (@voltronik)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/wrong-notification-on-post-update-with-gravity-forms-post-updates-plugin/#post-8667917)
 * Hi [@kostasni](https://wordpress.org/support/users/kostasni/),
    Thanks for your
   reply.
 * So pleased you got it working and thanks for posting a comprehensive answer on
   how to fix this issue should anyone else run into the problem.
 * If you like BNFW and the support, please feel free to [leave an honest review](https://wordpress.org/support/plugin/bnfw/reviews/#new-post).
 * Thanks,
    Jack

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Wrong notification on Post Update with Gravity Forms Post Updates plugin’
is closed to new replies.

 * ![](https://ps.w.org/bnfw/assets/icon.svg?rev=2531573)
 * [Customize WordPress Emails and Alerts - Better Notifications for WP](https://wordpress.org/plugins/bnfw/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bnfw/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bnfw/)
 * [Active Topics](https://wordpress.org/support/plugin/bnfw/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bnfw/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bnfw/reviews/)

## Tags

 * [better notifications for wordpress](https://wordpress.org/support/topic-tag/better-notifications-for-wordpress/)

 * 5 replies
 * 2 participants
 * Last reply from: [Jack – BNFW](https://wordpress.org/support/users/voltronik/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/wrong-notification-on-post-update-with-gravity-forms-post-updates-plugin/#post-8667917)
 * Status: resolved