Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

all.

I found this site via a Google search that led me to this topic: How to Protect Uploads, if User is not Logged In?

It looks like that solution would work for my situation (including hakre's addition). However, I am struggling to find exactly how I would go about putting all of it together and implementing it on my WP site.

So, I was wondering if anybody would be..."interested"... in putting together a step-by-step guide on how to implement that solution.

For some background...

  • My site is using the Members plugin (http://wordpress.org/plugins/members/) with OneAll Social Login (http://wordpress.org/plugins/oa-social-login/).
  • Anyone can register on my site. However, they are initially registered in a restricted "role" via the Members plugin where they can only view one page. If they attempt to view any other page, they are redirected back to that one page. I then have the ability to review the registrant and move them to an "authorized" role, giving them access to the site.
  • In an ideal world, I'd like to restrict all media to people in the "authorized" role. However, at this point, I'd settle for just requiring people to be registered/logged-in.
  • My WP site just contains info about my family that I want to keep private. Photos are a big part of it, which is why I want to keep them private, just like my posts.
  • The creator of the Members plugin said he may be interested in building this functionality into his plugin in the future, but I'd rather not wait for that.

Thank you!!

share|improve this question
1  
This sounds more like a job description. Please show us your efforts, what you've tried, where you are stuck, etc. Thanks. –  kaiser Sep 16 '13 at 21:47
    
I apologize for not being able to provide more information. I realize I probably made a foul by posting on this forum since I am not a developer. However, that is the exact reason why I posted such an open-ended request. I'll try to set apart some time soon to try some things myself. I'm a new father, so time is hard to come by, but I don't mind doing some work myself! –  Matt Nolan Sep 25 '13 at 1:08
    
As far as posting a job description, I wouldn't be opposed to paying someone to do little projects like this for me. I have already contributed to a couple Plugin authors for advanced support. So, I apologize if I'm coming off as disrespectful, but I also want to be clear that I'm not someone that isn't willing to put in work where I can (i.e. I have the knowledge/skills) or compensate when I feel it is necessary (again, due to my lack of knowledge/skills). Like I said though, I'll try to do what I can and report back! :) –  Matt Nolan Sep 25 '13 at 1:09
add comment

1 Answer

Figured this out after finding this page: http://www.0to5blog.com/tips/protecting-wordpress-media-uploads-unless-user-is-logged-in/

That page contains the instructions I was looking for, exactly!

I tweaked the dl-file.php code slightly to meet my needs:

if ( !current_user_can( 'read_private_posts' ) || !is_user_logged_in() ) { 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.