Skip to content

Instantly share code, notes, and snippets.

@rafaehlers
Created June 10, 2022 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaehlers/b0984524f599bdb25ba96bb5719a07d9 to your computer and use it in GitHub Desktop.
Save rafaehlers/b0984524f599bdb25ba96bb5719a07d9 to your computer and use it in GitHub Desktop.
Highlight an entire row if entry was created by currently logged-in user
<?php // DO NOT COPY THIS LINE
add_filter( 'gravityview/template/table/entry/class', function( $class, $context ) {
if ( ! is_user_logged_in() ) {
return $class;
}
$view_id = $context->view->ID;
$current_user_id = get_current_user_id();
if($view_id == 25){
if ( $context->entry['created_by'] == $current_user_id ) {
$class .= ' currentuser';
}
}
return $class;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment