Created
October 4, 2011 12:07
-
-
Save thomasgriffin/1261479 to your computer and use it in GitHub Desktop.
Gravity Forms admin entry row highlighting
This file contains 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 | |
/* 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