Created
February 20, 2018 00:09
-
-
Save Idealien/ea785fd8e91d775b6958d3bb184eeddb to your computer and use it in GitHub Desktop.
Gravity Flow Status Column with Step Time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gravityflow_columns_status_table', 'custom_column_titles', 10, 3 ); | |
function custom_column_titles( $columns, $args, $table ) { | |
$columns['last_updated'] = 'Last Updated'; | |
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 == 'last_updated' ) { | |
$duration = time() - $entry['workflow_timestamp']; | |
$value = gravity_flow()->format_duration( $duration ); | |
} | |
return $value; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment