Title: Examples for post_view_cap
Last modified: August 21, 2016

---

# Examples for post_view_cap

 *  Resolved [zwene](https://wordpress.org/support/users/zwene/)
 * (@zwene)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/examples-for-post_view_cap/)
 * Hi,
 * can you give some examples of the usage of post_view_cap? Which caps must I use
   to match for registered users or guests? I can’t get it work in php and functions.
 * I want to match if the current user have access to post.
 * How I can easily test with the post_view_cap if current_user have read access
   to a post? Is there something like virtual standard user group/cap like “has_access”
   or something else?
 * Greetings,
    zwene
 * [http://wordpress.org/plugins/wp-access-areas/](http://wordpress.org/plugins/wp-access-areas/)

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

 *  Thread Starter [zwene](https://wordpress.org/support/users/zwene/)
 * (@zwene)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/examples-for-post_view_cap/#post-4206313)
 * Ahhh, now I found out after a look in your plugin code. Wouldn’t it be better
   to put a reference of your wpaa conditional functions somewhere on the plugin
   page …?
 * After reading for a while I test it with
 * `wpaa_user_can( 'read', $EM_Event )`
 * and
 * `wpaa_user_can( 'read' )`
 * but this don’t work ($EM_Event is an event id from an event calendar). 🙁 In 
   the moment I can’t match a wpaa conditional for a specific page like
 * `current_user_can( 'read', $post->ID )`
 * right?
 *  Plugin Author [podpirate](https://wordpress.org/support/users/podpirate/)
 * (@podpirate)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/examples-for-post_view_cap/#post-4206530)
 * yep, you’re right.
    In the next version `wpaa_user_can()` will simply accept 
   a second argument and pass it to `current_user_can()` regards, j.
 *  Plugin Author [podpirate](https://wordpress.org/support/users/podpirate/)
 * (@podpirate)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/examples-for-post_view_cap/#post-4206555)
 * I’ll close this.

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

The topic ‘Examples for post_view_cap’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-access-areas_616579.svg)
 * [Access Areas for WordPress](https://wordpress.org/plugins/wp-access-areas/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-access-areas/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-access-areas/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-access-areas/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-access-areas/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-access-areas/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [podpirate](https://wordpress.org/support/users/podpirate/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/examples-for-post_view_cap/#post-4206555)
 * Status: resolved