Skip Navigation

[Resolved] Edit text “Add new” in my Toolset form

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to replace the text "Aggiungi nuovo" shown in Forms for repeating fields.

Solution: Use custom code to filter this text:

add_filter( 'gettext', 'tssupp_custom_translate', 20, 3 );
/**
 * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
 */
function tssupp_custom_translate( $translated_text, $text, $domain ) {
   
    if ( $text == 'Add new' && $domain = 'wpv-views' ){
        $translated_text = "YOUR TEXT HERE";
    }
   
    return $translated_text;
}
This support ticket is created 3 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 4.06 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by zenariM 3 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1998007
Form.JPG

Hi, where can I edit the text "Aggiungi nuovo" (english: "Add new") to add a repeating field?

Thanks

#1998331
Screen Shot 2021-03-23 at 4.38.03 PM.png

Hello, there is no built-in option for changing this text, so you need a small custom code snippet. You can add this snippet to your child theme's functions.php file, or to a new code snippet in Toolset > Settings > Custom Code:

add_filter( 'gettext', 'tssupp_custom_translate', 20, 3 );
/**
 * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
 */
function tssupp_custom_translate( $translated_text, $text, $domain ) {
  
    if ( $text == 'Add new' && $domain = 'wpv-views' ){
        $translated_text = "YOUR TEXT HERE";
    }
  
    return $translated_text;
}

Replace YOUR TEXT HERE with the text you want to display instead of "Aggiungi nuovo". If you use the custom code snippet editor, be sure to set the snippet to run everywhere and activate the snippet. Example in the screenshot here.

#1998741

My issue is resolved now. Thank you!