Preserve Child Entry’s Original “created_by” Property

Experimental Snippet 🧪

This snippet will need to be revisited if we ever use the GP_Nested_Forms::handle_parent_submission_post_save() filter to handle anything besides setting the child entry “created_by” property.

Code

Filename: gpnf-preserve-child-entry-created-by.php

<?php
/**
 * Gravity Perks // Nested Forms // Preserve Child Entry's Original "created_by" Property
 * https://gravitywiz.com/documentation/gravity-forms-nested-forms/
 *
 * Experimental Snippet 🧪
 *
 * This snippet will need to be revisited if we ever use the GP_Nested_Forms::handle_parent_submission_post_save() filter
 * to handle anything besides setting the child entry "created_by" property.
 */
add_action( 'init', function() {
	if ( is_callable( 'gp_nested_forms' ) ) {
		remove_action( 'gform_entry_post_save', array( gp_nested_forms(), 'handle_parent_submission_post_save' ), 20 );
	}
}, 16 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.