Description
The gravityflow_entry_detail_args filter allows the entry detail arguments to be overridden.
Parameters
Parameter | Type | Details |
---|---|---|
$args | Array | The entry detail page arguments. |
Examples
Enable the timeline if the logged in user has the administrator role
1 2 3 4 5 6 7 8 9 10 11 12 | add_filter( 'gravityflow_entry_detail_args' , 'sh_gravityflow_entry_detail_args' ); function sh_gravityflow_entry_detail_args( $args ) { $user_roles = wp_get_current_user()->roles; if ( in_array( 'administrator' , $user_roles ) ) { $args [ 'timeline' ] = false; } else { $args [ 'timeline' ] = false; } gravity_flow()->log_debug( __METHOD__ . '() args: ' . print_r( $args , true ) ); return $args ; } |
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?