Gform postimage caption

Description

This filter is executed when creating the Post Image Caption field and can be used to modify the "Caption" label

Usage

Applies to all forms

<?php
add_filter("gform_postimage_caption", "change_postimage_caption", 10, 2);
?>


Applies to a specific form. In this case, form Id 5

<?php
add_filter("gform_postimage_caption_5", "change_postimage_caption", 10, 2);
?>

Parameters

$label

(string) The label to be filtered.


$form_id

(int) The current form's id.

Examples

This example changes the default Post Image Caption label;


<?php
add_filter("gform_postimage_caption", "change_postimage_caption", 10, 2);
function change_postimage_caption($label, $form_id){
    return "Image Caption";
}
?>

Source Code

This filter is located in common.php

Search the Documentation