gform_required_legend

gform_required_legend

DescriptionUsageParametersExamples1. Use a custom legendPlacementSinceSource Code

Description

The gform_required_legend filter enables the legend displayed at the bottom of the form header, which explains how required fields are indicated, to be overridden.

Usage

add_filter( 'gform_required_legend', 'your_function_name', 10, 2 );

You can also specify this per form by adding the form id after the filter name.

add_filter( 'gform_required_legend_6', 'your_function_name', 10, 2 );

Parameters

$ledend stringThe required indicator legend.$form Form ObjectThe current form object.

Examples

1. Use a custom legend

add_filter( 'gform_required_legend', function( $legend, $form ) {    return 'your custom legend here';}, 10, 2 );

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.5.

Source Code

This filter is located in GFFormDisplay::get_form() in form_display.php.

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註