[wp-hackers] Restricting access to specific users

William P. Davis will.davis at gmail.com
Sun Apr 10 21:43:36 UTC 2011

I would probably save the IDs of the users who are allowed access as postmeta, and then before displaying the article check get_currentuser_data. If the ID isn't in the array then die gracefully. You could probably use a filter to ensure those articles don't show in archive pages, too.

Alternatively, if there's just a group of users that will always see those articles, create a new user level and give them permission to read private articles, then use WP's built-in functionality for that. 
------Original Message------
From: Hannit Cohen
Sender: wp-hackers-bounces at lists.automattic.com
To: wp-hackers at lists.automattic.com
ReplyTo: wp-hackers at lists.automattic.com
Subject: [wp-hackers] Restricting access to specific users
Sent: Apr 10, 2011 4:26 PM

I have a site that displays the content only to registered users.
Most of the content is shared to all the users, but some of it is user
Any ideat as to how I can restrict(and display) content per specific user ?

חנית כהן
קוד-ארט פיתוח בע"מ
hannit at codeart.co.il
wp-hackers mailing list
wp-hackers at lists.automattic.com

Sent from my BlackBerry® wireless device

More information about the wp-hackers mailing list