I've an issue with the plugin "Advanced Custom Fields". The steps that I follows are:
1. Create post programmatically
$id_post = wp_insert_post(array(
'post_type'=>$post_type,
'post_title'=>$post_title,
'post_status' => 'publish'
));
2. Update all the repeater fields associated to the "post_type"
if( have_rows('cliente',$id_post) ) {
$i = 0;
while( have_rows('cliente',$id_post) ) {
the_row();
update_sub_field('id', 333);
}
}
The issue is at the point 2, infact when I create a post with Wordpress' interface (with a button) and i insert manually the id of that post in my code, it works perfectly..
but when i create a post programmatically at the second point the repeater field isn't recognized even if I put the number of that post create programmatically.
Works only if the post is create with the button "Insert New".
Do you have any suggestion?
Thanks to all!