WordPress.org

Ready to get started?Download WordPress

Forums

Custom capability (roles & capability) (1 post)

  1. keriat
    Member
    Posted 3 years ago #

    Hello, guys!
    I lurk over web and can't find solution, so asking here.
    I want to add custom role with custom capability "view-gallery": add_role('customer', 'Customer', array('view-gallery')).
    The question. Can I somehow check this capability for selected post? Like current_user_can( 'edit_post', $post_id ); but with my "view-gallery"? And sure I need to set up some posts to "white list". So, is there core-solution? I can make it myself, but prefer to use wordpress functionality instead of creating my own bicycle.

Topic Closed

This topic has been closed to new replies.

About this Topic