<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Can comment filter not working, help? - How-to and Troubleshooting				            </title>
            <link>https://wpdiscuz.com/community/troubleshooting/can-comment-filter-not-working-help/</link>
            <description>wpDiscuz WordPress Comment Plugin Community. Support and Resources.</description>
            <language>en-US</language>
            <lastBuildDate>Sat, 07 Mar 2026 00:41:03 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: Can comment filter not working, help?</title>
                        <link>https://wpdiscuz.com/community/troubleshooting/can-comment-filter-not-working-help/#post-13937</link>
                        <pubDate>Thu, 07 Apr 2022 07:42:52 +0000</pubDate>
                        <description><![CDATA[Hi,
Please try out this hook code:
add_filter(&#039;wpdiscuz_user_role_can_comment&#039;, function ($canComment) {
    $user = wp_get_current_user();
    return in_array( &#039;Paidplanrole&#039;, (array) $...]]></description>
                        <content:encoded><![CDATA[<p>Hi,</p>
<p>Please try out this hook code:</p>
<pre contenteditable="false">add_filter('wpdiscuz_user_role_can_comment', function ($canComment) {
    $user = wp_get_current_user();
    return in_array( 'Paidplanrole', (array) $user-&gt;roles);
}, 11);</pre>]]></content:encoded>
						                            <category domain="https://wpdiscuz.com/community/troubleshooting/">How-to and Troubleshooting</category>                        <dc:creator>Asti</dc:creator>
                        <guid isPermaLink="true">https://wpdiscuz.com/community/troubleshooting/can-comment-filter-not-working-help/#post-13937</guid>
                    </item>
				                    <item>
                        <title>Can comment filter not working, help?</title>
                        <link>https://wpdiscuz.com/community/troubleshooting/can-comment-filter-not-working-help/#post-13929</link>
                        <pubDate>Tue, 05 Apr 2022 20:26:20 +0000</pubDate>
                        <description><![CDATA[Hi, I am referencing from the previous question posted. Link here: 
The solution provided was the following filter shown below (link):
add_filter(&quot;wpdiscuz_user_role_can_comment&quot;, function...]]></description>
                        <content:encoded><![CDATA[<p>Hi, I am referencing from the <a href="https://wpdiscuz.com/community/troubleshooting/allow-only-certain-roles-to-comment/" target="_blank" rel="noopener">previous question posted. Link here</a>: </p>
<p>The solution provided was the following filter shown below (<a href="https://wpdiscuz.com/docs/codex/filters/wpdiscuz_user_role_can_comment/" target="_blank" rel="noopener">link</a>):</p>
<p>add_filter("wpdiscuz_user_role_can_comment", function ($canComment, $role) {<br />if ($role === "Paidplanrole") {<br />$canComment = true;<br />}<br />return $canComment;<br />}, 10, 2);</p>
<p> </p>
<p>Like the user that previously posted, My users have a basic subscriber role for the free plan and then a new role for the paid plans. So every paying user gets 2 roles: subscriber and paidplanrole.</p>
<p>If I block subscriber roles from commenting, no one is able to comment because every user has subscriber auto set. </p>
<p>I tried adding the filter above to my functions.php and set the paidplanrole can comment. </p>
<p>It did not work at all. Anyone can comment whether or not they have paidplanrole. </p>
<p>I would like it to be only users that have paidplanrole assigned to them can comment. </p>
<p>Is this possible?</p>
<p>Thank you!</p>]]></content:encoded>
						                            <category domain="https://wpdiscuz.com/community/troubleshooting/">How-to and Troubleshooting</category>                        <dc:creator>beachcalsix@aol.com</dc:creator>
                        <guid isPermaLink="true">https://wpdiscuz.com/community/troubleshooting/can-comment-filter-not-working-help/#post-13929</guid>
                    </item>
							        </channel>
        </rss>
		