I found the other recent thread regarding a similar question. That works (editing the theme’s function.php file) but if you reload the page… the image disappears. That’s okay. At least the user sees what they uploaded and they likely won’t reload.
Hi, regarding your first post, it can be done with the following hook:
if (!function_exists('wfu_after_upload_handler')) {
function wfu_after_upload_handler($changable_data, $additional_data) {
$link = "http://staging.iptanus.com/test-4-2/?wfuuid=".$additional_data["unique_id"]."&wfufid=";
$fid = "";
foreach ( $additional_data["files"] as $ind => $file ) {
if ( $file["upload_result"] == "success" || $file["upload_result"] == "warning" ) {
$fid = $ind;
break;
}
}
if ( $fid !== "" ) $changable_data["js_script"] = 'window.location.href = "'.$link.$fid.'"';
return $changable_data;
}
add_filter('wfu_after_upload', 'wfu_after_upload_handler', 10, 2);
}
if (!function_exists('wfu_show_uploaded_image_handler')) {
function wfu_show_uploaded_image_handler($incomingfrompost) {
$output = "";
if ( isset($_GET["wfuuid"]) && isset($_GET["wfufid"]) && WFU_USVAR_exists("filedata_".$_GET["wfuuid"]) ) {
$files = WFU_USVAR("filedata_".$_GET["wfuuid"]);
if ( isset($files[$_GET["wfufid"]]) && file_exists($files[$_GET["wfufid"]]["filepath"]) ) {
$url = str_replace(ABSPATH, site_url().'/', $files[$_GET["wfufid"]]["filepath"]);
$output .= '<div>';
$output .= '<img src="'.$url.'" />';
$output .= '</div>';
}
}
return $output;
}
add_shortcode("wfu_show_uploaded_image", "wfu_show_uploaded_image_handler");
}
You need to replace “http://staging.iptanus.com/test-4-2” in $link with the redirect URL in your case.
You need also to put the shortcode [wfu_show_uploaded_image] in the destination page. This shortcode will be replaced by the image.
Regards
Nickolas
That works. Thank you sir