Action uncanny-automator-pro

uap_gf_list_row_submitted

Fires after a Gravity Forms entry row is processed and added to the Ultimate Affiliate Pro affiliate list.

add_action( 'uap_gf_list_row_submitted', $callback, 10, 4 );

Description

Fires after each individual row within a Gravity Forms multi-field/list field is processed during an automation. Developers can use this action hook to access the submitted entry, form, and specific row data to perform custom actions or modifications on a per-row basis.


Usage

add_action( 'uap_gf_list_row_submitted', 'your_function_name', 10, 4 );

Parameters

$entry (mixed)
This parameter contains the Gravity Forms entry object, which holds all submitted data for a specific form submission.
$form (mixed)
The `$entry` parameter contains the Gravity Forms entry data for the submitted form.
$row (mixed)
This parameter holds the Gravity Forms object representing the submitted form.
$field (mixed)
This parameter contains an array representing a single row of data from the submitted Gravity Forms sub-list field, including its row number and the values within that row.

Examples

<?php
/**
 * Example function to hook into the 'uap_gf_list_row_submitted' action.
 * This function will be executed every time a row within a Gravity Forms List field is submitted.
 * It logs the submitted row data to the WordPress debug log.
 *
 * @param array $entry      The Gravity Forms entry object.
 * @param array $form       The Gravity Forms form object.
 * @param array $row        The data for the specific row that was submitted.
 *                          Contains 'row_number' and 'values' (an array of field values for that row).
 * @param array $field      The Gravity Forms field object for the List field.
 */
function my_uncanny_automator_log_gf_list_row( $entry, $form, $row, $field ) {
	// Ensure WP_DEBUG is enabled for this to show up in the debug log.
	if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
		$log_message = sprintf(
			'Uncanny Automator Pro: Gravity Forms List Row Submitted - Form ID: %d, Entry ID: %d, Field ID: %d, Row Number: %d',
			$form['id'],
			$entry['id'],
			$field['id'],
			$row['row_number']
		);
		error_log( $log_message );

		// Log the actual row values for detailed inspection.
		error_log( 'Row Values: ' . print_r( $row['values'], true ) );
	}
}

// Hook the function to the action.
// The third parameter '4' indicates that this function accepts 4 arguments.
add_action( 'uap_gf_list_row_submitted', 'my_uncanny_automator_log_gf_list_row', 10, 4 );

?>

Placement

This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.


Source Code

uncanny-automator-pro/src/integrations/gravity-forms/triggers/anon-gf-sublist.php:123

public function process_list_rows( $field, $entry, $form ) {

		$rows = unserialize( rgar( $entry, $field->id ) );

		if ( empty( $rows ) ) {
			return;
		}

		foreach ( $rows as $row_number => $values ) {

			$row = array(
				'row_number' => $row_number,
				'values'     => $values,
			);

			do_action( 'uap_gf_list_row_submitted', $entry, $form, $row, $field );
		}
	}

Scroll to Top