Using Gravity Forms ‘gform_editor_sidebar_panel_content’ PHP action

The gform_editor_sidebar_panel_content action hook is used to echo the content for a custom panel in the form editor sidebar.

Usage

A generic example of how to use the function:

add_action('gform_editor_sidebar_panel_content', 'your_function_name', 10, 2);

Target a specific tab:

add_action('gform_editor_sidebar_panel_content_thepanelid', 'your_function_name', 10, 2);

Target a specific tab and form:

add_action('gform_editor_sidebar_panel_content_thepanelid_6', 'your_function_name', 10, 2);

Parameters

  • $panel (array) – The properties of the panel being displayed.
  • $form (Form Object) – The form currently being edited.

More information

See Gravity Forms Docs: gform_editor_sidebar_panel_content

Implemented in Gravity Forms v2.5. Source code is located in GFFormDetail::forms_page() in form_detail.php.

Examples

Add a new panel

A detailed explanation of what the code does:
This example adds a new custom panel to the form editor sidebar with content.

Code example:

add_action('gform_editor_sidebar_panel_content_my_custom_panel_1', function($panel, $form) {
    echo 'the content of my custom panel.';
}, 10, 2);

Placement:
This code should be placed in the functions.php file of your active theme or a custom functions plugin.