The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Custom capability (roles & capability) (1 post)

  1. keriat
    Posted 5 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