gform_shortcode_builder_forms

gform_shortcode_builder_forms

DescriptionUsageParametersExamples1. RemovePlacementSinceSource Code

Description
The gform_shortcode_builder_forms filter allows the list of available forms displayed in the shortcode builder to be overridden.
Usage
The filter would be used like so:
add_filter( 'gform_shortcode_builder_forms', 'your_function_name' );

Parameters

$forms array
A collection of active forms on site using the form id as the key to the form title.

Examples
1. Remove
This example removes form id 1 from the list of forms which can be embedded using the shortcode builder.
add_filter( 'gform_shortcode_builder_forms', function ( $forms ) {
unset( $forms[1] );

return $forms;
} );

Placement
This code should be placed in the functions.php file of your active theme or a custom functions plugin.
Since
This filter was added in Gravity Forms v2.4.22.5.
Source Code
This filter is located in GFForms::get_shortcodes() in gravityforms.php.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注