Last active
August 29, 2015 14:12
-
-
Save mcguffin/7cbfb0dab73eb32cb4a2 to your computer and use it in GitHub Desktop.
WordPress Plugin greying out disabled buttons
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 | |
/* | |
Plugin Name: Grey out Disabled | |
Plugin URI: https://gist.github.com/mcguffin/7cbfb0dab73eb32cb4a2 | |
Description: Grey out disabled submit buttons | |
Author: Jörn Lund | |
Author URI: http://github.org/mcguffin | |
Version: 0.0.1 | |
*/ | |
function recapcha_grey_out_disabled_button_css() { | |
// inject script only in frontend | |
global $pagenow; | |
if ( ! is_admin() && $pagenow !== 'wp-login.php' ) { | |
?><style type="text/css"> | |
input[type='submit'][disabled],button[disabled] { | |
color:#999; | |
background-color:#ccc; | |
} | |
</style><?php | |
} | |
} | |
add_action('wp_print_scripts','recapcha_grey_out_disabled_button_css'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment