Multiple images in forms and captions
Started by: igorL-3
in: Toolset Professional Support
Quick solution available
Problem:
The problem here is that the user wanted to upload multiple images into their repeatable image field all at once when using our Toolset Forms
Solution:
This can be done on your form's edit page under Other Settings. Just enable "Use the WordPress Media Library manager for image, video, audio, or file fields"
This will give you access to the wordpress media library uploader that can allow you to upload multiple images at once.
2
7
4 years, 7 months ago
igorL-3
custom SELECT field with dynamic data
Started by: Luciana
in: Toolset Professional Support
Quick solution available
Problem:
The problem here is that the user wanted to dynamically populate their select field with the information of another post type.
Solution:
This can be done by using the function below.
// Put the code of your snippet below this comment.
add_filter( 'wpt_field_options', 'func_dynamic_populate', 10, 3);
function func_dynamic_populate( $options, $title, $type ){
switch( $title ){
case 'winery-select': //select field slug goes here
$options = array();
$args = array(
'post_type' => 'wineries',
'post_status' => 'publish');
$posts_array = get_posts( $args );
foreach ($posts_array as $post) {
$options[] = array(
'#value' => $post->ID,
'#title' => $post->post_title,
);
}
break;
}
return $options;
}
This can be added to your Toolset Custom code section at Toolset -> Settings -> Custom Code.
Relevant Documentation:
For further information on this code you can have a look at our documentation below.
https://toolset.com/documentation/programmer-reference/types-api-filters/#wpt_field_options
2
8
4 years, 7 months ago
Luciana