Change WordPress user roles and capabilities Forums How to or FAQ php code to check if user have permissions on a post

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3665
    grupogg
    Participant

    Hello, I need some information, because i need to know how can i do in php code,check if user or user role have permissions on a post.

    thanks

    #3670
    Vladimir
    Keymaster

    Hi,

    What permissions do you wish to check: edit or view?

    #3673
    Vladimir
    Keymaster

    Hi,

    There is a special public method, which you can call to check if user can view a post or not:

    URE_Content_View_Restrictions::current_user_can_view($post_id)

    Unfortunately, it works incorrectly for some restriction settings, as discovered recently. I work on a fix. It will be available next week.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.