Hi, I suppose that you are adding the uploaded files in Media Library (as attachments) and you want to set the title and caption of the attachment.
Here is a hook that does this, not by using wfu_after_upload hook, but by subclassing wfu_process_media_insert() function.
if ( isset($GLOBALS["WFU_GLOBALS"]["WFU_DEBUG"]) ) $GLOBALS["WFU_GLOBALS"]["WFU_DEBUG"][3] = "ON";
if (!function_exists('wfu_debug_wfu_process_media_insert_function_handler')) {
function wfu_debug_wfu_process_media_insert_function_handler($res, $file_path, $userdata_fields, $page_id) {
$attach_id = $res["output"];
if ( $attach_id ) {
$title = ( isset($userdata_fields[0]) ? $userdata_fields[0]["value"] : "" );
$description = ( isset($userdata_fields[2]) ? $userdata_fields[2]["value"] : "" );
$args = array( 'ID' => $attach_id, 'post_title' => $title, 'post_content' => $description );
wp_update_post( $args );
$categories = ( isset($userdata_fields[1]) ? explode(",", $userdata_fields[1]["value"]) : array() );
foreach ( $categories as $slug ) {
$cat = get_category_by_slug( $slug );
if ( $cat !== false ) wp_set_object_terms( $attach_id, $slug, 'category', true );
}
}
$res["result"] = 'R';
return $res;
}
add_filter('wfu_debug-wfu_process_media_insert', 'wfu_debug_wfu_process_media_insert_function_handler', 10, 4);
$GLOBALS['wfu_debug_end-wfu_process_media_insert'] = "1";
}
Best Regards
Nickolas