• This is a feature request: the plugin lets me create restricted posts and I have many. Recently, I developed a simple plugin that sends the title of the post and of course its link to a Telegram private channel. Anything works fine but users (users of the website too) need to be logged in to see the restricted content. Problem is registered users of the website are the real target of the protected content, while casual visitors, crawlers, etc. are not. There’s a plugin that lets you generate a shareable link that bypasses the restricted content. My feature request: in WPM create restricted posts that can be red by people having the link. Adding time too could be useful (eg the link is valid until a certain date). Adding the ability to get the shareable link of a post from another plugin code would be fantastic. 😊

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    In theory, it wouldn’t be all that complicated to set up something like that in the existing API. The heavy lifting would be building the management of it (creating links, storage, deletion, expiration, etc).

    One possibility would be this: The wpmem_set_as_logged_in() function will set a user as logged in if you pass this function the user ID. If you passed a code unique to the user, you could use some early action – some action prior to content but late so all plugins, user info, and content info is loaded – so template_redirect is probably a good choice. In the action function, check the code (presuming it’s passed as a query string in the URL) and if valid, use the set as logged in function to set the user as logged in so they can view the content.

    Another possibility could be one that is not user specific, but would be similar. Use the wpmem_securify filter hook. In the filter function, pick up the code (same as above) and validate it. If it’s valid, return the original content.

    Thread Starter islp

    (@islp)

    I think I’ll keep dreaming, Chad 😉

    Jokes aside, at the moment I would also consider a bland solution based on the referer, eg. users coming from the private Telegram channel can read the unrestricted post (I know perfectly well that this solves a very specific case and is too generic to become a feature for your plugin)

    • This reply was modified 1 year, 6 months ago by islp.
    • This reply was modified 1 year, 6 months ago by islp.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Dream feature’ is closed to new replies.