BoldGrid / weforms

7 stars 12 forks source link

No ability to change form Sub Label text in weForms #227

Open SitesByYogi opened 5 months ago

SitesByYogi commented 5 months ago

In this case user wants to change the sub labels for "First" and "last" name to German from the form editor. It would make since in this case for weForms to have the ability to change the text label.

https://snipboard.io/iCWOyJ.jpg

As a workaround can just use placeholder text and hide the sub labels or add something like this to the functions.php file or a code snippets plugin:

function weforms_change_strings( $translations, $text, $domain ) {
    if ( 'weforms' === $domain ) {
        if ( 'First' === $text ) {
            return 'custom first';
        }
        if ( 'Last' === $text ) {
            return 'custom last';
        }

    }
    return $translations;
}
add_filter( 'gettext', 'weforms_change_strings', 10, 3 );