Having an odd issue with get_field reurning an empty string when called inside an update filter add_filter( 'acf/update_value/name=field-name', array($this, 'acf_hash_password_field'), 10, 3);
it seems the get_field
function will only ever return an empty string but if I use get_post_meta
I’m able to get the actual value stored in the database.
public function acf_hash_password_field( $value, $post_id, $field ) {
if ( !empty($value) ) {
$return_value = wp_hash_password($value);
} else {
* Get field returns an empty string *
$return_value = get_field('field-name', $post_id);
* get_post_meta returns the value stored in the DB *
$return_value = get_post_meta( $post_id, 'field-name', true );
}
return $return_value;
}