Description
This filter is executed when creating the name prefix field and can be used to modify the "Prefix" label
Usage
Applies to all forms
<?php
add_filter("gform_name_prefix", "change_prefix", 10, 2);
?>
Applies to a specific form. In this case, form Id 5
<?php
add_filter("gform_name_prefix_5", "change_prefix", 10, 2);
?>
Parameters
$label
- (string) The label to be filtered.
$form_id
- (int) The current form's id.
Examples
This example changes the default name prefix label;
<?php
add_filter("gform_name_prefix", "change_name_prefix", 10, 2);
function change_name_prefix($label, $form_id){
return "Name Prefix";
}
?>
Source Code
This filter is located in common.php and js.php