gravityflow_field_value_status_table

The gravityflow_field_value_status_table filter can be used to override the values which appears in the columns of the Workflow status table.

Parameters

$label     string

The value that is to be displayed.

$form_id  integer

The Form ID of the entry for the current row.

$column_name     string

The id of the column currently being processed.

$entry   Entry Object

The entry for the current row.

Examples

The following example shows how you can replace the entry ID with the value from a form field.

add_filter( 'gravityflow_field_value_status_table', 'sh_gravityflow_field_value_status_table', 10, 4 );
function sh_gravityflow_field_value_status_table( $label, $form_id, $column_name, $entry ) {
	if ( $form_id == 2 && $column_name == 'id' ) {
		$label = rgar( $entry, '191' );
	}
	return $label;
}

Following example adds an assignee column to Status tab

add_filter( 'gravityflow_columns_status_table', 'custom_column_titles', 10, 3 );
function custom_column_titles( $columns, $args, $table ) {
	$new_column = array(
		'assignees' => 'Assignee(s)',
	);
	$pre_columns = array_slice( $columns, 0, 2 );
	$post_columns = array_slice( $columns, 2 );
	$columns = array_merge( $pre_columns, $new_column, $post_columns );
	return $columns;
}

add_filter( 'gravityflow_field_value_status_table', 'custom_column_field_values', 10, 4 );
function custom_column_field_values( $value, $form_id, $column_name, $entry ) {

	if ( $column_name == 'assignees' ) {

		$api = new Gravity_Flow_API( $form_id );
		$step = $api->get_current_step( $entry );
		if( $step !== false ) {
			$assignees = $step->get_assignees();

			if ( $assignees ) {
				foreach( $assignees as $assignee) {
					if( $assignee->get_type() === 'user_id' ) {
						$value .= "<ul>";
						$value .= $assignee->get_user()->display_name;
						$value .= "</ul>";
					}
				}
			}
		}

	}

	return $value;
}

Placement

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