gravityflow_inbox_submitter_name

The gravityflow_inbox_submitter_name filter can be used to override the value which appears in the Submitter column of the Workflow Inbox.

Parameters

$submitter_name   string

The display_name of the logged-in user who submitted the form or the guest ip address.

$entry   Entry Object

The entry object for the row currently being processed.

$form   Form Object

The form object for the current entry.

Examples

Example 1 - Replace the Submitter IP address with a value from a form
This example shows how you can replace the submitter ip address, stored in the entry created_by value when a non-logged in user submits the entry, with the value from a form field, such as a Name field.

add_filter( 'gravityflow_inbox_submitter_name', 'inbox_submitter_name', 10, 3 );
function inbox_submitter_name( $submitter_name, $entry, $form ) {
    if ( ! is_numeric( $entry['created_by'] ) ) {
        if ( $form['id'] == 2 ) {
            $submitter_name = rgar( $entry, '1.3' ) . ' ' . rgar( $entry, '1.6' );
        }
    }

    return $submitter_name;
}

Example 2 - Replace the Submitter Display Name with their User ID

add_filter( 'gravityflow_inbox_submitter_name', 'inbox_submitter_name', 10, 3 );
function inbox_submitter_name( $value, $entry, $form ) {
	if ( is_numeric( $entry['created_by'] ) ) {
		return $entry['created_by'];
	}
	return $value;
}

Placement

This code should be placed in the functions.php file of your active theme.