ID, 'download_file', true); if ($download_file) { global $current_user; get_currentuserinfo(); wp_redirect(ambdownload::getDownloadLink($current_user->user_email, $download_file)); exit; } } } } add_action( 'template_redirect', array('ambdownload', 'downloadRedirect'), 1, 2);