• I’m using the hook wpcf7_after_flamingo for sending data to an API after submitting a CF7 form.
    I’d like to update a field with the response from the API.

    Any idea on how to do it?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Allewar

    (@allewar)

    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, 7 months ago by Allewar.
    • This reply was modified 4 years, 7 months ago by Allewar.
    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Yes, you can access the post ID of Flamingo’s inbound message through the wpcf7_after_flamingo action hook. That is the primary purpose of the hook.

    Thread Starter Allewar

    (@allewar)

    Thanks for the reply.
    Can you help me with the method/object to get it?

    I’ve tried several but just can’t get it.

    Thread Starter Allewar

    (@allewar)

    Any help appreciated @takayukister
    It should take you a second.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Update stored field after insert using wpcf7_after_flamingo’ is closed to new replies.