gravityflow_note_valid

The gravityflow_note_valid filter is used to customize if a workflow note is valid or not.

Parameters

$valid               bool      Indicates if the note is valid.
$note               string    The submitted note.
$new_status  string     The new status for the current step.
$step              object     The current workflow step.

Examples

Example 1 - Only a specific workflow note text will be acceptable

add_filter( 'gravityflow_note_valid', 'my_gravityflow_note_valid', 10, 4 );
function my_gravityflow_note_valid( $valid, $note, $new_status, $step ) {
	
	// for a particular step, only a specific note can make the step note acceptable
	if ( $step->get_id() == 74 ) {
		if ( $note == 'Accepted' ) {
			$valid = true;
		}
		else {
			$valid = false;
		}
	}

	return $valid;
}

Placement

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