Code-Snippets-Functions/Execute a function on a child site/Gravity Forms/replace-merge-tab-form-title.txt

9 lines
332 B
Text

add_filter( 'gform_pre_replace_merge_tags', function ( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) {
$merge_tag = '{form_title}';
if ( strpos( $text, $merge_tag ) === false || empty( $form ) ) {
return $text;
}
return str_replace( $merge_tag, 'Your Custom Text', $text );
}, 10, 7 );