bookmark_bordergform_disable_post_creation

Description

Use this filter to disable post creation when submitting a Gravity Form

Usage

add_filter( 'gform_disable_post_creation', 'disable_post_creation', 10, 3 );

You can also specify this per form by adding the form id after the hook name.

add_filter( 'gform_disable_post_creation_6', 'disable_post_creation', 10, 3 );

Parameters

  • $is_disabled bool

    Variable to be filtered. Set it to true to prevent posts from being created

  • $form

    Current form.

  • $entry Entry Object

    Current Entry array

Examples

This example disables the post creation process for all forms

add_filter( 'gform_disable_post_creation', 'disable_post_creation', 10, 3 );
function disable_post_creation( $is_disabled, $form, $entry ) {
    return true;
}

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

This filter is located in GFCommon::create_post() in common.php