Created
June 19, 2015 13:24
-
-
Save macbookandrew/99ee787baa93a28a3880 to your computer and use it in GitHub Desktop.
Wordpress - disable login password autocomplete (PCI compliance)
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 | |
/** | |
* Plugin Name: Disable login autocomplete | |
* Description: Disable login password autocomplete | |
* Version: 1.0 | |
* Author: Benjamin Uzelac | |
* Author URI: https://buzelac.com | |
* License: WTFPL | |
*/ | |
add_action( 'login_init', 'acme_autocomplete_login_init' ); | |
function acme_autocomplete_login_init() { | |
ob_start(); | |
} | |
add_action( 'login_form', 'acme_autocomplete_login_form' ); | |
function acme_autocomplete_login_form() { | |
$content = ob_get_contents(); | |
ob_end_clean(); | |
$content = str_replace('id="user_pass"', 'id="user_pass" autocomplete="off"', $content); | |
echo $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment