formcierge_before_status_change
Filter
Since v1.0.0
Filter the target status before an entry's status is changed. Return a different status string to override, or return the original to allow the change.
Parameters
$new_status
string
The status being applied.
$entry_id
int
The entry ID.
includes/Controllers/EntryController.php
Basic Usage
add_filter( 'formcierge_before_status_change', function ( $new_status, $entry_id ) {
if ( $new_status === 'completed' && my_entry_has_open_notes( $entry_id ) ) {
return 'in-progress';
}
return $new_status;
}, 10, 2 );