gravityflowformconnector_update_entry_approval_status
The filter gravityflowformconnector_update_entry_approval_status can be used for setting the approval status without having to use a field on the form to define the status.
Parameters
Parameter | Type | Definition |
---|---|---|
$status | string | The status of the target step. |
$target_entry_id | Integer | The ID of the target entry. |
$target_form_id | Integer | The Id of the target form |
$entry | Entry Object | The current entry |
$form | Form Object | The current form. |
$step | Step Object | The current workflow step. |
Examples
Example 1 - Set the status of the Approval step to Approved?
Accepts the ID of an Approval step ''the_step_id' and sets it's Status to Approved
add_filter('gravityflowformconnector_update_entry_approval_status', 'gf_set_approval_status', 10, 6); function gf_set_approval_status( $status, $target_entry_id, $target_form_id, $entry, $form, $step) { if ( in_array( $step->get_id(), array( 'the_step_id' ) ) ) { $status = 'approved'; } return $status; }
Placement
This code should be placed in the functions.php file of your active theme or in a custom functions plugin.