• Resolved Rudolph88

    (@rudolph88)


    Hi,

    Thanks for the great plugin, we’re using it on a membership site and loving it.

    We’re using Restrict Content Pro and would like to know if there is an easy way or code that would help us solve our dilemma. When our members are expired or cancel their subscription, their user roles do not change (they stay subscribers).

    We understand that for every wpDiscuz “Form”, you can disable commenting based on the user’s role. Since the non-active member’s roles are still subscribers, that doesn’t help us remove their capability of commenting. Is there an action or filter we can hook into so that we can check if our subscriber is active vs non-active?

    We know we can get this done with your documentation of over-writing the files here: http://wpdiscuz.com/docs/wpdiscuz-documentation/custom-template-and-style/ , BUT we’d like to avoid this and use a filter or hook in for future updates to be optimized.

    Thanks in advance!

Viewing 1 replies (of 1 total)
  • Plugin Author gVectors Team

    (@gvectors-team)

    Thank you Rudolph88,
    We’ve added new hook in user role restriction function. This will be available in next version release. At the moment you can do this change in wpDiscuz files too.
    Open /wpdiscuz/forms/wpdFormAttr/Form.php file,
    Find this line:

    if (in_array($role, $this->generalOptions['roles_cannot_comment'])) {
                        $user_can_comment = false;

    Change to this:

    if (in_array($role, $this->generalOptions['roles_cannot_comment'])) {
                        $user_can_comment = apply_filters( 'wpdiscuz_user_role_can_comment', false, $role );

    You should disable Subscribers in form settings. Then use wpdiscuz_user_role_can_comment hook to change the false to true if current user role $role is Subscriber but it’s an active user.

Viewing 1 replies (of 1 total)

The topic ‘Restrict Content Pro Compatibility’ is closed to new replies.