Advance Post Creation - post_id and post_url not working

Hi I am trying to add a link on the text type confirmation which will lead the user to their post submitted as draft.

Preview Your Obituary

the issue is that post_id and post_url merge tag is not working

Thanks

Out of the box, add-on feeds are processed via a separate background request, which can occur after submission, so the post might not have been created, and the related entry meta might not have been set when merge tags are processed for notifications and confirmations.

The gform_is_feed_asynchronous filter can be used to disable background processing, so the feed is processed in the same request as the form submission before the notifications are sent and the before the confirmation is displayed: gform_is_feed_asynchronous - Gravity Forms Documentation

Is this correct @richardw8k ?

add_filter( 'gform_is_feed_asynchronous', function ( $is_asynchronous, $feed, $entry, $form ) {
    $target_slug = 'gravityformsadvancedpostcreation';
    if ( rgar( $feed, 'gravityformsadvancedpostcreation' ) === $target_slug ) {
        $is_asynchronous = true;
    }
 
    return $is_asynchronous;
}, 10, 4 );

Only the $target_slug = 'the-slug-goes-here'; and $is_asynchronous = true; lines should be changed, e.g.

add_filter( 'gform_is_feed_asynchronous', function ( $is_asynchronous, $feed, $entry, $form ) {
    $target_slug = 'gravityformsadvancedpostcreation';
    if ( rgar( $feed, 'addon_slug' ) === $target_slug ) {
        $is_asynchronous = false;
    }
 
    return $is_asynchronous;
}, 10, 4 );
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.