Last active
May 16, 2016 20:03
-
-
Save gohrco/086a1d0e43a1b45482ba133f2cd5b5b1 to your computer and use it in GitHub Desktop.
Add AutoComplete to WHMCS Admin Forms
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 | |
/** | |
* Function to add hidden text / password fields for autofillers to use instead | |
*/ | |
add_hook( 'AdminAreaHeadOutput', 1, function( $vars ) { | |
return <<< HTML | |
<input type="text" style="display:none"> | |
<input type="password" style="display:none"> | |
HTML; | |
}); | |
/** | |
* Function to apply autocomplete="off" to input fields | |
*/ | |
add_hook( 'AdminAreaFooterOutput', 1, function( $vars ) { | |
return <<< HTML | |
<script type="text/javascript"> | |
jQuery(document).ready( function() { | |
jQuery('input').attr('autocomplete','off'); | |
}); | |
</script> | |
HTML; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment