您可以使用相同的机制将一些JavaScript排队,以实际删除按钮:
function remove_wp_hide_pw_button() {
?><script>
if ((document.addEventListener != null) && (document.querySelector != null)) {
document.addEventListener( \'DOMContentLoaded\', function() {
var b = document.querySelector(\'button.wp-hide-pw\');
if (b != null) b.remove();
});
}
</script>
<?php
}
add_action(\'login_footer\', \'remove_wp_hide_pw_button\');
但是按钮会短暂出现然后消失,因此您可能需要CSS将其隐藏在按钮或图标中。