Support

Account

Home Forums Add-ons Gallery Field Uploaded Gallery Images visible to all in media library

Solving

Uploaded Gallery Images visible to all in media library

  • Hi there, I have added a Gallery to user profiles, and Im using a front end form to allow each user to update it. In the gallery option I have ‘Library’ set to ‘Uploaded to Post’.

    When I log in as a user and edit the profile, I am able to see other users uploaded images in the media library, but I only want to be able to see images for the logged in user. How would I go about setting that up?

    Thanks

    Robert.

  • You need to create a pre_get_posts filter that limits attachments to only those belonging to the current user.

    https://wordpress.stackexchange.com/questions/1482/restricting-users-to-view-only-media-library-items-they-have-uploaded

  • Great, thanks for that, will looking to the pre_get_posts filter.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.