gf_has_action

Description

Determines if a callback has been registered for the specified action.

Usage

gf_has_action( array( 'action_name', $modifier1 ) );

Parameters

  • $action array

    Array containing the action tag as well as the possible modifiers.
  • $function_to_check bool|callable

    The optional callback to check for.

Returns

Returns boolean for whether the hook has any callbacks registered or if a specific callback is registered.

Examples

$result = gf_has_action( array( 'gform_after_submission', $form_id ) );
$result = gf_has_action( array( 'gform_after_submission', $form_id ), 'the_function_name' );

Since

This function was added in Gravity Forms version 2.4.18.

Source Code

This action hook is located in gravityforms.php