I'm using s2member plugin to restrict downloads. it has several hooks that can be used to customize the functionality.
here are the hooks documentation :
this works :
wp_redirect( '/thank-you/' ); exit;
but if I use the after download access hook, it doesn't work, the hook doesn't seem to fire.
also, if a non member tries to download, they are redirected to a register page, I'd like the download to start automatically once they register and log in.
From what I see, the function uses exit() before the action running..
this might terminated the function, so ws_plugin__s2member_before_file_download_access won't work, [[LINK href="http://www.primothemes.com/forums/viewtopic.php?t=10126&p=20923"]]this thread[[/LINK]] have the same issue with the hook.
paul de wouters comments:
the ws_plugin__s2member_before_file_download_access hook works, the ws_plugin__s2member_after_file_download_access doesn't.
and I'm the one who posted that question on the s2member forums :)
Yes, ws_plugin__s2member_before_file_download_access will work because it fired before the script terminated with php exit(), and ws_plugin__s2member_after_file_download_access fired after exit() run.
You can check their position on s2member codex..