Hello
here is my code, I create a product when I first save a custom post type
add_action( 'acf/save_post', 'aph_save' );
function aph_save($post_id)
{
if (!empty(get_field( "_aph_product_id", $post_id ))) {
return; // already got the product so we don't create it again
}
// create woo commerce product
// ...
// save product_id to acf
update_field('_aph_product_id', $product_id, $post_id);
}
the problem is that the meta field _aph_product_id on the custom post type form is not update just after the save action, I have to refresh the WP edit page to have it displayed. Is there a way to force the refresh of the form ?