Support

Account

Forum Replies Created

  • Just popping in to provide this information on hashing/unhashing because the link to andrewwho.nl is no longer.

    function dec_enc($action, $string) {
        $output = false;
     
        $encrypt_method = "AES-256-CBC";
        $secret_key = 'This is my secret key';
        $secret_iv = 'This is my secret iv';
     
        // hash
        $key = hash('sha256', $secret_key);
        
        // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning
        $iv = substr(hash('sha256', $secret_iv), 0, 16);
     
        if( $action == 'encrypt' ) {
            $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);
            $output = base64_encode($output);
        }
        else if( $action == 'decrypt' ){
            $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);
        }
     
        return $output;
    }

    Source: https://web.archive.org/web/20161229224924/https://andrewho.nl/encrypt-decrypt-strings-php-easy-way/

  • Thank you for your swift reply!

    It’s unfortunate that the taxonomy field is not modular in the way I expected it to be since it would’ve made sense for the fields to function in the way I expected. Eespecially since how the documentation was worded, there wasn’t any reason for me to believe it wouldn’t work.

    Thank you! I’ll consider building an acf/save_post action after a think about the effort/reward levels. It might just be something I include in the documentation for the editors and if they wonder why something isn’t showing up, then they’ll email me lol

  • I’m trying to do exactly this, and I’d love to know what approach you took where you didn’t need this anymore!

Viewing 3 posts - 1 through 3 (of 3 total)