I managed to use wp_get_recent_posts() to get the last post and its ID, but I’m not sure if it is reliable when simultaneous forms are sent.
$recent_posts = wp_get_recent_posts(array(
'numberposts' => 1,
'post_type' => 'flamingo_inbound'
));
$post_id = $recent_posts[0]['ID'];
update_post_meta($post_id,'_field_status','NEW META VALUE');
This would definitely work if I could get the post ID inside the wpcf7_after_flaming action.
Any clue?
-
This reply was modified 4 years, 6 months ago by Allewar.
-
This reply was modified 4 years, 6 months ago by Allewar.