Divi Protect and post_password_required
Tagged: diviprotect password function
Hello, no that’s not what I’m wanting.
By logged in I meant that the password protected content password has been entered and the cookie set.
I have a wrapper function in use on links that are output on the protected content, via a shortcode. That works great but I don’t want people to be able to share the link outside of having logged into the password protected content. But if they have the cookie set (the same condition as the WP built-in function) then the link will work.
The way I’ve used the wrapper function in the past is to check that ( ! post_password_required() ), the link then works and a forced download is pushed to the browser. Otherwise a message is returned to state that they must log in to access the link.
I think this only works on password protected pages – as this is technically not a password protected page, it won’t work.
Are these links on your website? I wonder if I could create the ability to “restrict” certain pages/posts on your website based on the protect section. So there will be an option to specify which pages can ONLY be seen if they have the cookie set on their browser.
Would this work for you?
Yes that’s right, that function only works for password protected posts (via WordPress).
Not “Restricting” certain pages/posts is the main reason I bought this plugin because it allows for all other content on the page to be visible. If you could create a function that, based on the post ID, returns true or false if the cookie is set for protect content then that would work.
You must be logged in to reply to this topic.