WordPress.org

Forums

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

  1. zwene
    Member
    Posted 1 year 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 1 year 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 1 year 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 1 year ago #

    I'll close this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Access Areas
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.