Skip to content

Instantly share code, notes, and snippets.

@rafaehlers
Last active May 12, 2021 20:25
Show Gist options
  • Save rafaehlers/076c1a18bcc4e536971d2a2813725665 to your computer and use it in GitHub Desktop.
Save rafaehlers/076c1a18bcc4e536971d2a2813725665 to your computer and use it in GitHub Desktop.
Highlight an entire row if entry is approved
<?php // DO NOT COPY THIS LINE
// https://github.com/gravityview/GravityView/issues/1315
add_filter( 'gravityview/template/table/entry/class', function( $class, $context ) {
$view_id = $context->view->ID;
if($view_id == 8){
if ( $context->entry['is_approved'] == 1 ) {
$class .= ' highlight'; // If this entry is approved then add the highlight class
}
}
return $class;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment