WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Restrict access to post media (3 posts)

  1. dancingdonkey
    Member
    Posted 2 years ago #

    Hi there.

    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?

  2. dancingdonkey
    Member
    Posted 2 years ago #

    For instance a featured image on a post might have a path of http://www.yoursite.uk/wp-content/uploads/2012/04/image.jpg and if you were to navigate to that path you would see the image. Even if the post itself was private.

    Is there no way to restrict access to those files?

  3. dancingdonkey
    Member
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic