Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
709 views
in Plugins by

I added "&& (!$rules['closed'])" to " $rules['commentbutton']=..." but that only disabled commenting on the question itself.  I can still comment on the answers.

Q2A version: 1.5.2
related to an answer for: How to REALLY close the Closed question?

1 Answer

+1 vote
by

I think I figured it out:

$rules['closed'] didn't disable comments because its checking if the comment itself is closed.  You have to check whether the parent is closed or not.  So instead I added:

&& (($post['type']=='A' && !$parentpost['closed']) || ($post['type']=='Q' && !$rules['closed']));

and seemed to have worked.

...