Skip to content

Instantly share code, notes, and snippets.

@mcguffin
Last active August 29, 2015 14:12
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 mcguffin/7cbfb0dab73eb32cb4a2 to your computer and use it in GitHub Desktop.
Save mcguffin/7cbfb0dab73eb32cb4a2 to your computer and use it in GitHub Desktop.
WordPress Plugin greying out disabled buttons
<?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