update_field always returns FALSE | WordPress.org

[ad_1]

Hello, I noticed that update_field is working only for the first time and it returns TRUE, but all next changes will return FALSE.

Not sure if that’s specific for users, here’s my code:

$values = array( 'user_gender' => 'male', );
$updated = update_field('custom_fields', $values, 'user_45');

$updated will return TRUE in the first attempt and FALSE in all the others, even though it DOES update the field correctly, but that’s bad if you wanna work with conditions.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer