WordPress.org

Ready to get started?Download WordPress

Forums

WP-Members
Restrict content only to users with a certain role (3 posts)

  1. renet
    Member
    Posted 6 months ago #

    Hi,

    I haven't installed the plugin yet. What I want to know is: Is is possible to restrict access to pages for users with a certain role, only? So e.g. "Subscribers" are not allowed to see the content, but "Administrators" and "Authors" are?

    Thanks in advance! :)

    Regards,
    René

    https://wordpress.org/plugins/wp-members/

  2. renet
    Member
    Posted 6 months ago #

    And on top, if this is possible: Can I determine whether the currently logged in user has access to a page or not in my theme (I'm a theme dev), so I can simply hide menu Items of pages that the user doesn't have access to?

  3. Chad Butler
    Member
    Plugin Author

    Posted 5 months ago #

    You could probably do that with either the wpmem_block filter. This filter returns a value based on whether content should be blocked or not (true|false). You could set up a filter function to return a boolean based on the the user's role.

    http://rocketgeek.com/plugins/wp-members/users-guide/filter-hooks/wpmem_block/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags