Description
The gravityflow_inbox_submitter_name filter can be used to override the value which appears in the Submitter column of the Workflow Inbox.
Parameters
| Parameter | Type | Details |
|---|---|---|
| $submitter_name | String | The display_name of the logged-in user who submitted the form or the guest ip address. |
| $entry | Entry | The entry object for the row currently being processed. |
| $form | Form | The form object for the current entry. |
Examples
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.
1 2 3 4 5 6 7 8 9 10 | 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;} |
Replace the Submitter Display Name with their User ID
1 2 3 4 5 6 7 | 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 can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?