Hi Victor,
I just had a custom shortcode solution from support which get's the preview into an HTML field.
Here is the solution to that ------
You can create a custom shortcode and use the WordPress hook https://developer.wordpress.org/reference/functions/wp_get_attachment_url/ to return the image URL form the file ID.
1 Your file upload field will return the ID of the file on the next page of the form
2 Create a custom shortcode, and then pass the ID of the file upload field into the shortcode
3 You can then add tag into a HTML field on the second page of your form.
Add the shortcode to your site, and use this on the second page of your form //Where X is the ID of the file upload field on page 1.
function get_image_url( $atts ){
if ( ! empty( $atts['file_id'] ) ) {
return wp_get_attachment_url( $atts['file_id'] );
}
return "";
}
add_shortcode( 'myfile', 'get_image_url' );
Thanks for the link..... I will check it out and let you know.
Regards,
Nick
I thought of this as well but I was trying to avoid a round trip to the server when all the details are already on the form.
Please login or Register to submit your answer