Hi, i´ve a custom field called “administradores”. Type of field is “User” and it supports multiple selection.
If i update a post with that field on the WP Admin, i get something like that on wp_postmeta table:
a:1:{i:0;s:1:”1″;}
When i update that field using add_post_meta function, i use this:
add_post_meta($post_id,’administradores’,$administradores);
$administradores is an array of user IDs.
However, if i update that field via WP API, using add_post_meta or ACF update_field function, i get something like:
a:1:{i:0;i:1;}
It looks like ACF works both ways, because y see the right data on WP admin. But the problem is that i have to use a reverse query on my theme, something like:
‘meta_query’ => array(
‘relation’ => ‘AND’,
array(
‘key’ => ‘administradores’,
‘value’ => ‘:’ . $current_user->ID . ‘;’,
‘compare’ => ‘LIKE’
)
)
and it dont work if i update the field via webservice. I´m using ACFPro v5.2.3, but same thing happens with last version of ACF.
How can i update a user field properly????