I have a custom plugin that allows my user to generate a post in a set format by adding some data and uploading a file in a form.
This way they don’t have to worry about formatting the post.
One of their requirements was to have some of these posts only accessible by certain users. In other words to have them be private but not in the WordPress sense.
Having the post meet this requirement was simple enough but I was concerned about the access to the media that would be uploaded if it were simply to reside at a server path.
To overcome this, I saved the files as blobs in a custom database and they can only be viewed via a php file which also checks if the user has access.
This works really well but I am rewriting my plugin and was wondering if there was a way to meet the customers requirement while still having the files saved to the server?
- The topic ‘Restrict access to post media’ is closed to new replies.