You can try to inject an autocomplete
attribute into the form element on that page. There is a dedicated action for that: user_edit_form_tag
.
add_action( 'user_edit_form_tag', function() {
print ' autocomplete="off"';
});
If that doesn’t help – and it looks like the new IE has a bug here – you could try the solution from this Stack Overflow answer.
Here is some untested(!) code. jQuery is always available on the page, so we don’t have to take care of that. Note that I nested the callback registrations, because the constant IS_PROFILE_PAGE
is only defined when the action user_edit_form_tag
has been actually called.
add_action( 'user_edit_form_tag', function() {
print ' autocomplete="off"';
// See https://stackoverflow.com/questions/22817801/how-to-disable-auto-fill-in-safari-7
$extra_action = IS_PROFILE_PAGE ? 'show_user_profile' : 'edit_user_profile';
add_action( $extra_action, function() {
?>
<style>
.douchebag_safari {
position: fixed;
width: 1px;
left: -5000px;
}
.douchebag_safari input {
width: 1%;
}
</style>
<div class="douchebag_safari">
<input class="js-clear_field" tabindex="-1" name="e-mail" type="email">
<input class="js-clear_field" tabindex="-1" name="Ecom_User_Password" type="password">
</div>
<?php
add_action( 'admin_print_footer_scripts', function() {
?>
<script>
jQuery('#your-profile').on('submit', function () {
"use strict";
jQuery('.js-clear_field').attr('disabled', 'disabled');
}
</script>
<?php
});
});
});