Parse Parent Merge Tags for Webhooks Add-on

Note: Merge tags must be specified in their “complicated” format to avoid being processed prematurely in the child form context. Example: {Parent:2} → {%GPNF:Parent:2%}

Code

Filename: gpnf-parse-parent-merge-tags-in-webhooks.php

<?php
/**
 * Gravity Perks // Nested Forms // Parse Parent Merge Tags for Webhooks Add-on
 * https://gravitywiz.com/documentation/gravity-forms-nested-forms/
 *
 * Note: Merge tags must be specified in their "complicated" format to avoid being processed prematurely in the child form context.
 * Example: {Parent:2} → {%GPNF:Parent:2%}
 */
add_filter( 'gform_webhooks_request_data', function( $request_data, $feed, $entry, $form ) {

	foreach ( $request_data as $key => &$value ) {
		$value = gpnf_parent_merge_tag()->parse_parent_merge_tag( $value, $form, $entry, true, true, false, 'text' );
	}

	return $request_data;
}, 10, 4 );

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.