gform_editor_sidebar_panel_content

Description

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

Usage

The base action which would run for all forms and all custom tabs would be used like so:

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

You can target a specific tab by adding the tab id after the hook name.

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

You can target a specific tab and form by adding the id’s after the hook name.

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.

Examples

1. Add a new panel

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.

Since

This action hook was added in Gravity Forms v2.5.

Source Code

This action hook is located in GFFormDetail::forms_page() in form_detail.php