I really think you should consider implementing this. Maybe by making it possible to add all,-1,-3,-6 or something similar in the options field.
However, since it is not possible at the moment I tried the fix that @KTS915 provided in the last post I linked to and it does not work for me.
I have tried replacing the filter with the with ws_plugin__s2member_options, as I could not find any mention of option_ws_plugin__s2member_options in the s2member codex.
The filter runs, however, think I am filtering the wrong (too early?) place as there is nothing returned is I run get_the_ID() and the unset command is never fired. I also tried adding the filter in the parse_query action, but that never fired.
I hope someone can help.
Before you starting hookingâŚwhy not tell us what you are trying to do. That isâŚwhat problem are you trying to solve using s2member. Donât describe your solutionâŚtell us your what you are trying to protect / not protect.
There are many ways to lock / unlock content via s2member without resorting to code. Just pick the right configuration.
Sure, but it is a bit tricky, that is why I left it out. But you might be able to tell me I donât need this
I want my users to be able to send a link that is protected by the s2member download key to a third party. Because the download key latches on to the userâs IP and user agent I need the download_key to be generated by this third party. In order to make that happen I need them (third party) to hit a public page of my choosing where I can generate the key for them. (The visit to this public page will be validated by a key I made)
So:
User generates link (To the public page with my validation key)
Third party visits this link where a download key is created for the user (and the user is redirected to download the file). Subsequent visits to the public page with correct validation will not generate new download key, but serve the one already made.
I might be able to live with a time based link that does not consider IP, however the âuniversalâ and âip-foreverâ directives that you can provide the s2memeber_file_download_key function are too broad.
I hope you get it. It is a bit tricky and if there is another way please let me know
I figured out how to make it work for one day for all IPs and user agents.
I have chosen to go with a more advanced version of this, so I donât need the requested feature anymore. However, I still feel it should be implemented.
Thanks for the help @onepresstech
Posting the one day tweak here for people who might need it:
Interesting use case. Will work erratically though for ADSL users (ADSL carriers routinely re-allocate IP addresses to running systems) and users that switch their modem off at night. Most people donât have dedicated IP addresses. It should work fine 99% of the time if the link timeout is short. The longer the link timeout the more failures will occur. Depends on how people are using it. If this is a quick here it is / download it / delete from server then it should work fine.