Advanced Custom Fields ACF Password field and MD5 Hashing

By North Street, A Creative Studio

ACF is great, but there can be some security concerns. Primary among them from front-end posting, is Passwords. If you ever find yourself using the “PASSWORD” ACF field type, make sure you hash it so you’re not storing the password as plain text!

It’s dead simple, drop this bit into functions.php

/* http://biostall.com/hashing-acf-password-type-fields-in-wordpress/ */
function ns_function_encrypt_passwords( $value, $post_id, $field  )
{
    $value = wp_hash_password( $value );
 
    return $value;
}
add_filter('acf/update_value/type=password', 'ns_function_encrypt_passwords', 10, 3);
About north street

We engineer the thoughtful transformation of great organizations. Our proven process helps us understand what your competitors are doing right — and wrong. Want to learn more? Let’s chat.

More Notes

Collage of colorful shapes, mobile phones, and text.

Welcome to Your 2024 Branding Pep Talk

A bowler hat floating on top of radio waves in the background

CEO Tom Conlon Talks Shop on Podcast Marketing Secrets

Tom Conlon

CEO Tom Conlon in Conversation with The Opinionistics