Gform_get_meta returns nothing [RESOLVED]

HI,

I have the following snippet of code that has been working for several years. Recently updated GravityForms and now it seems like the gform_get_meta function is not returning anything.

add_action( 'gform_after_submission', 'set_post_content', 10, 2 );
function set_post_content( $entry, $form ) {
     

    //if the Advanced Post Creation add-on is used, more than one post may be created for a form submission
    //the post ids are stored as an array in the entry meta
    $created_posts = gform_get_meta( $entry['id'], 'gravityformsadvancedpostcreation_post_id' );
    foreach ( $created_posts as $objpost )
    {
        $post_id = $objpost['post_id'];
        $post = get_post( $post_id );


I cannot figure out why it is returning empty.  When I use phpAdmin to look at the meta table, I can see the records in there.

Thanks,
Westley

Hey Westley,

It looks like the hook has not been depricated and still available in the following URL. Do you have any update regarding this, @chrishajer?

If it is on tap to be deprecated, what should I use instead?

This is because Advanced Post Creation Add-On feeds now run asynchronously, meaning when your custom hook runs, the post has not been created yet.

You can change this using the gform_is_feed_asynchronous filter to disable async feed processing for Advanced Post Creation feeds.

Thanks a lot Travis!

That did the trick. I just wish somewhere in the documentation I had seen a reference to that or at least the fact that the Advanced Post Creation Add-on switched to asynchronous processing.

Thanks again!

1 Like

The following page of the documentation lists which add-ons use async/background processing and the version it was enabled in: