Add parameters to 3rd party callback function

I tried…but ended up going a completely different direction, as there appears to be no viable solution. I ended Storing in a temporary database entry. Does potentially have race conditions, if two people are using the same account. But for those who are interested, here was my solution:

I am using the very effective plugin call UserYourDrive as the file upload interface. They were kind enough to provide callbacks that proved to be of assistance in this problem.

I am using the current user, as they must be logged in to perform this task. Current user is the binding element.

Starting at the shortcode, enter the :

mmd_InsertFileUploadCoreData($current_user->ID, $ListId, $RideCount, $OrderId);   // straight 1st time load

But you have to made sure that this is not a post response, thus, if nothing is set for posting, only then do you call the initial core data, with the elements you need later.

Once the upload is complete, the call back is recieved. This is where you store the file name of the uploaded file.

mmd_InsertFileUploadName($current_user->ID, $UploadedFileName);   // Don't save it. We only have the userid to find it.

When the user clicks on the submit button, containing the rest of the form data, only then do you clear the temporary stored data.

 mmd_DeleteFileUploadData($current_user->ID);

It does have a potential race-condition hole, but that should be a rare occurance.
Code set:

add_action('useyourdrive_upload_post_process', 'mmd_store_upload_information', 10, 2); // Start watching the upload
function mmd_store_upload_information($uploaded_entries, $processor)
{ 
 $ListId        = NULL;
 $OrderId       = NULL;
 $RideCount     = NULL;
 $current_user = wp_get_current_user();
 $Record        = mmd_FindFileUploadData($current_user->ID);
 if(!empty($Record))
     {
     $ListId        = $Record['ListId'];
     $OrderId       = $Record['OrderId'];
     $RideCount     = $Record['RideId'];
     $DBId          = $Record['id'];
     unset($Record);                           // Clear the record
     mmd_DebugLog('READ  UserId: ' . $current_user->ID .  ' List Id: ' . $ListId . '  OrderId: ' . $OrderId  . 'Ride Count:' .  $RideCount);
     }
  else
   return;   // Nothing here, so bail out.   
 
 if($ListId == NULL || $ListId == "")
    return;
 
 if($OrderId == NULL || $OrderId == "")
    return;
    
 if($RideCount == NULL || $RideCount == "")
    return; 
  
 $entries = (array)$uploaded_entries;   
 foreach ($entries as $cached_node) 
       {
        $Node = (array)$cached_node; 
        if(empty($Node['name']))
          continue;
                
        $UploadedFileName = $Node['name'];
        $DownloadLink     = $Node['direct_download_link'];  
        mmd_InsertFileUploadName($current_user->ID, $UploadedFileName);   // Don't save it. We only have the userid to find it.
        mmd_StoreUploadedFileName( $ListId, $OrderId, $RideCount, $UploadedFileName, $DownloadLink );
        break;
    }   
}


function mmd_InsertFileUploadName($UserId, $FileName)
{
global $wpdb;   
$Table_Name = $wpdb->prefix.'mmd_temp_fileupload_data'; 
$sql_query = $wpdb->prepare( "UPDATE $Table_Name SET FileName = %s WHERE UserId = %d", $FileName, $UserId);
$wpdb->query( $sql_query );     

}


function mmd_InsertFileUploadName($UserId, $FileName)
{
global $wpdb;   
$Table_Name = $wpdb->prefix.'mmd_temp_fileupload_data'; 
$sql_query = $wpdb->prepare( "UPDATE $Table_Name SET FileName = %s WHERE UserId = %d", $FileName, $UserId);
$wpdb->query( $sql_query ); 


}




function mmd_FindFileUploadData($UserId)
{
global $wpdb;   
$Table_Name = $wpdb->prefix.'mmd_temp_fileupload_data'; 
$sql_query  = $wpdb->prepare("SELECT * FROM $Table_Name WHERE UserId=%d", $UserId);
 $Record    = $wpdb->get_row($sql_query, ARRAY_A);

return $Record;     
}


function mmd_DeleteFileUploadData($UserId)
{
global $wpdb;   
$Table_Name = $wpdb->prefix.'mmd_temp_fileupload_data'; 
$sql_query  = $wpdb->prepare("DELETE FROM $Table_Name WHERE UserId=%d", $UserId);
$wpdb->query( $sql_query );
}