Try adding this to your theme’s functions.php file
function Get_curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
add_filter('gettext','custom_login_to_download_msg');
function custom_login_to_download_msg( $input ) {
if( !is_admin() && 'You must be logged in to download this file. <br/><br/><a href="%1$s"><strong>?† Back to %2$s</strong></a>' == $input )
return 'You must be logged in to download this file. <br/><br/>
<a href="<?php echo wp_login_url(Get_curPageURL()); ?>" title="Login"><Strong>Login To Download</Strong></a><br/><br/>
<a href="%1$s"><strong>?† Back to %2$s</strong></a>';
return $input;
}
Which should give you :
And the Login to Download Link will start the download automatically once they are logged in.