I recently was dealing with the exact same problem. I didn’t solve it, and we decided that since people had to pay a relatively large sum for their listings that they would be sufficiently incented not to post bad stuff. Plus it would be a pain to manually approve each one — people don’t like waiting a day to get results.
So we gave our directory_member
user level the publish_posts
and edit_published_posts
capabilities from the start. They have to go through the payment process before the post is published; once they’ve paid they can do anything they want with their post.
But I had a brainwave (rare) looking at your question. I think where I went wrong is only have one directory_member
level, rather than directory_member
and directory_member_approved
. The latter would have the edit_published_posts
capability; the former would not. It would be relatively simple to bump the user up when an admin publishes the post for the first time.
The other possibility is assigning the edit_published_posts
capability on the fly based on a user meta field, in admin_init
or somewhere. But somehow I suspect the idea of having two explicit levels is better.
Let me know what you end up doing.