The example code you’ve posted isn’t really clear.
But to create a link to a post title (assuming it’s within the loop), use:
within html
<a href="<?php the_permalink(); "><?php the_title() ?></a>
the_title(); outputs data to the browser immediately
or
within php tags <?php ?>
echo '<a href="'.get_permalink().'">'.get_the_title().'</a>';
The wp_handle_upload action passes data you can modify to your function and expects the data or modified data to be returned in the same format that was passed in.
Modify your function this way:
function my_own_function( $data )
{
/**
* $data contains array(
* 'file' => $new_file,
* 'url' => $url,
* 'type' => $type
* )
*/
//do your stuff within the function here
return $data;
}