Limited Support
Dear Clients and Partners, we wish you a Merry Christmas and a Happy New Year! May this season bring you joy, peace, and good times with your loved ones.
Our support will be limited during the holidays, and we will return to full service on January 7.
Thank you for your understanding.
We appreciate your support this year and look forward to working with you in the new year.
Happy Holidays!
I built the following code using another forum discussion. However, the original code was developed so that the reply form would still be visible. Can anybody tell me how to modify the code so that it also hides the reply comment form? I want this code to eliminate ALL commenting for users that meet the specified criteria. Thanks for any help.
add_filter('wpdiscuz_form_render', 'pp_hide_comment_form', 10, 3); function pp_hide_comment_form($output, $commentsCount, $currentUser) { // specify list of tags that trigger loss of commenting privileges $disallowed_tags = array('Email-Status-invalid', 'Email-Status-spamtrap', 'Email-Status-do_not_mail'); // hide the comment form if user has a disallowed tag if (!empty($currentUser->ID) && wpf_has_tag($disallowed_tags)) { $output = preg_replace('~<div class="wpd-form[^"\']+wpd-main-form-wrapper[^>]+>.*?(<div id="wpdiscuz_hidden_secondary_form")~is', '$1', $output); } return $output; }
Original thread for reference: https://wpdiscuz.com/community/troubleshooting/disable-main-form-only-allow-reply/#post-10130
Follow-up: I was able to fix this by simply changing the $ouput to an alert message that informs the user their commenting ability has been disabled.