Skip to content

Instantly share code, notes, and snippets.

@thomasgriffin
Created October 4, 2011 12:07
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 thomasgriffin/1261479 to your computer and use it in GitHub Desktop.
Save thomasgriffin/1261479 to your computer and use it in GitHub Desktop.
Gravity Forms admin entry row highlighting
<?php
/* Use jQuery to target rating areas and add classes
------------------------------------------------------------ */
add_action( 'admin_print_scripts', 'tgm_target_colors', 20 );
function tgm_target_colors() {
global $current_screen;
if ( 'forms_page_gf_entries' !== $current_screen->id )
return;
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("body.forms_page_gf_entries #lead_form .author-self td:contains('Yes'), body.forms_page_gf_entries #post-body .entry-detail-view td:contains('Yes')").parent("tr").addClass("yes");
jQuery("body.forms_page_gf_entries #lead_form .author-self td:contains('No'), body.forms_page_gf_entries #post-body .entry-detail-view td:contains('No')").parent("tr").addClass("no");
jQuery("body.forms_page_gf_entries #lead_form .author-self td:contains('Maybe'), body.forms_page_gf_entries #post-body .entry-detail-view td:contains('Maybe')").parent("tr").addClass("maybe");
});
</script>
<?php
}
/* Color the rating system for casting submissions
------------------------------------------------------------ */
add_action( 'admin_print_styles', 'tgm_print_color' );
function tgm_print_color() {
global $current_screen;
if ( 'forms_page_gf_entries' !== $current_screen->id )
return;
echo '<style type="text/css">tr.yes { background: #ebffe8; } tr.no { background: #ffebe8; } tr.maybe { background: #ffffe0; }</style>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment