WordPress.org

Forums

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

  1. renet
    Member
    Posted 1 year 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 1 year 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 1 year 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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-Members
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags