Using Gravity Forms ‘gform_loaded’ PHP action

The gform_loaded Gravity Forms action is triggered when Gravity Forms is loaded. Use this hook to initialize any functionality that depends on Gravity Forms.

Usage

add_action('gform_loaded', 'my_function', 10, 0);

Parameters

This action does not have any parameters.

More information

See Gravity Forms Docs: gform_loaded

This action hook is located in gravityforms.php.

Examples

Initialize a custom function

Initialize a custom function when Gravity Forms is loaded.

function my_custom_function() {
    // Your custom code here
}
add_action('gform_loaded', 'my_custom_function', 10, 0);

Register a custom add-on

Register a custom add-on when Gravity Forms is loaded.

function register_my_addon() {
    // Register your custom add-on here
}
add_action('gform_loaded', 'register_my_addon', 10, 0);

Load custom scripts

Load custom scripts that depend on Gravity Forms.

function enqueue_my_custom_scripts() {
    // Enqueue your custom scripts here
}
add_action('gform_loaded', 'enqueue_my_custom_scripts', 10, 0);

Set up a custom database table

Set up a custom database table when Gravity Forms is loaded.

function create_my_custom_table() {
    // Create your custom database table here
}
add_action('gform_loaded', 'create_my_custom_table', 10, 0);

Initialize custom form fields

Initialize custom form fields when Gravity Forms is loaded.

function add_my_custom_form_fields() {
    // Add your custom form fields here
}
add_action('gform_loaded', 'add_my_custom_form_fields', 10, 0);