Randomize access to post

If I were doing such a thing, I’d do something like the following

  1. Determine how to tell which posts people could potentially gain access to, perhaps via a custom field.

  2. Store user meta data holding the posts they have gained access to

  3. Write a quick class (or a couple of functions) to handle (a) gathering the list of posts they already have been granted to, grab all potential posts (excluding those they have acces to), randomly picking one of the remaining posts to gran them access to, and then granting them access to it.

For example…

1) create a custom post meta named _members_randomly_allowed and set the value of it to 1 on each post that a member could gain access to

You could then pull the entire list using a WP_Query via the meta_key

2) decide that the saved data will be in an array on each member named _memebers_random_access

You could then read any existing meta for a member using get_user_meta

3) write a function to grant access to a random post they haven’t yet been granted access to

function grant_user_random_access( $user_id ) { ... };

4) add an action to the new user registration hook to gran them access to something

5) use wp_cron, running once per week, to grab all users and grant each of them random access to a new post

Obviously, there are cleaner ways to do such a thing but the above would work.