I'm interested in providing a secure file download in the admin section.
I've got it working by adding actions as such:
if(is_admin())
{
add_action('admin_menu', 'my_plugin_menu');
if($_GET['page'] == 'my-plugin-download')
add_action('admin_init', 'file_download_func');
}
I'm wondering if there is a better way to find out that the page is loaded, yet still send the content before http headers are sent. Any ideas?