WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Access Areas
[resolved] Examples for post_view_cap (4 posts)

  1. zwene
    Member
    Posted 9 months ago #

    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/

  2. zwene
    Member
    Posted 9 months ago #

    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?

  3. podpirate
    Member
    Plugin Author

    Posted 8 months ago #

    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.

  4. podpirate
    Member
    Plugin Author

    Posted 4 months ago #

    I'll close this.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.