Tell us what you are trying to do?
The long story is I need to convert images to base64 to add them as attachments to a CRM via API...
BUT my understanding is that in order to encode these images I need to first access the URLs of these images.
So something like $_POST["wpcf-problem-images-contact"] isn't going to get me what I need.
So, like the subject says, I need to access what I suspect is a value inside the field, and being a repeating field complicates that further.
Is there any documentation that you are following?
https://toolset.com/documentation/customizing-sites-using-php/functions/
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_ajax_upload_validate
Is there a similar example that we can see?
No.
What is the link to your site?
N/A
Hi,
To get the image URLs from a repeating image custom field, you can use the 'cred_save_data' hook, with the Types fields API function, for example:
add_action('cred_save_data', 'my_save_data_action',10,2);
function my_save_data_action($post_id, $form_data)
{
// if a specific form
if ($form_data['id']==12345)
{
$images = types_render_field( "image-field-slug", array( "item" => $post_id, "output" => "raw", "separator" => "," ) );
}
}
Note: You'll replace "12345" with the form's ID and the "image-field-slug" with the repeating image field's slug and you'll get the comma-separated list of image URLs in the '$images' variable.
Related documents:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
https://toolset.com/documentation/customizing-sites-using-php/functions/#image
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Sorry for the delayed response. This was EXACTLY what I was needing. Many thanks! My issue is resolved now.