Skip Navigation

[Resolved] label 'add new' multiple image field

This support ticket is created 5 years, 2 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#1329381
capture.jpg

Hi,

In a form, I would like to change the 'add new' label to a multiple image field (see capture). I can not find where can I change that ?

thanks.

Olivier

#1329783

Hi Olivier,

Thank you for contacting us and I'd be happy to assist.

To make the image field in the form, allow multiple image uploads, please go to that image field's settings ( WP Admin -> Toolset -> Custom Fields ), and select the option "Allow multiple-instances of this field".
( ref: https://toolset.com/documentation/user-guides/using-custom-fields/#how-to-add-custom-fields-to-content )

Example screenshot: hidden link

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1329915

Hi Waqar,
I already have a multiple field, I just want to change the label 'add new' which is displayed by default by another label.
Thanks,
Olivier

#1330143

Hi Olivier,

Thanks for writing back and for clearing this up.

To customize the default label text for the add new link, you can use "toolset_button_add_repetition_text" filter:


function toolset_button_add_repetition_text_callback( $string, $arg1 ) {

	$string = "Add more image";

	return $string;

}
add_filter( 'toolset_button_add_repetition_text', 'toolset_button_add_repetition_text_callback', 9999, 3 );

The above code can be included in the active theme's "functions.php" file and you can replace "Add more image" text as needed.

I hope this helps and please let me know how it goes.

Note: In case this doesn't work, please share the link to a page where this form can be seen.

regards,
Waqar

#1330201

Hi Waqar,
how i do when I have multiple types of repetable fields? I should have several different labels: 'add a file' 'add an image'. etc.
Thanks
Olivier

#1330259

Hi Olivier,

If you'd like to show different labels, for image and file type fields, you can include additional conditions to the custom function like this:


function toolset_button_add_repetition_text_callback( $string, $arg1 ) {
	
	// if image type field
	if($arg1['type'] == 'credimage') {
		$string = "Add more image";
	}

	// if file type field
	if($arg1['type'] == 'credfile') {
		$string = "Add more file";
	}
	
	return $string;

}
add_filter( 'toolset_button_add_repetition_text', 'toolset_button_add_repetition_text_callback', 9999, 3 );

I hope this helps and for more personalized assistance around custom code, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar

#1330427

My issue is resolved now. Thank you!