Created
July 26, 2018 15:03
-
-
Save nicomollet/955275fcb2aaf3c39c208f25cdf620be to your computer and use it in GitHub Desktop.
ACF Disable Autocomplete on input and textarea fields
This file contains hidden or 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 | |
/** | |
* ACF Disable Autocomplete on input and textarea fields | |
* Chrome ignores autocomplete="off" in some cases | |
* | |
* @author Nicolas Mollet | |
* @link https://bugs.chromium.org/p/chromium/issues/detail?id=468153 | |
*/ | |
function acf_input_disable_autocomplete() { | |
?> | |
<script type="text/javascript"> | |
(function($) { | |
$('.acf-input-wrap input, .acf-input textarea').attr('autocomplete', 'disableacf'); // use a random string other than off to disable it completely | |
})(jQuery); | |
</script> | |
<?php | |
} | |
add_action('acf/input/admin_footer', 'acf_input_disable_autocomplete'); |
Just change the 'disableacf' to 'new-password' and it works fine.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately, doesn't work anymore.