Limited Support
Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed.
We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.
Hi there,
Â
I try to disable the comment field, if the user has already commented on this post. But he should be able to reply to his own comment and other comments.
When I disable the form with this filter ...
function hide_form($output, $commentsCount, $currentUser) { return ''; } add_filter('wpdiscuz_form_render', 'hide_form', 10, 3);
... the form is disabled, but also the reply form.Â
Is there any way to do this?Â
Â
If I have a function to disable the main form, I will surround it with a check if the user has already made a comment. But I first need the form disable filter.
Thanks!
For everyone interested, here is the code to get if the current user already posted a level 0 comment:
global $post; $args = array( 'post_id' => $post->ID, 'author__in' => get_current_user_id(), 'parent' => 0, 'count' => true ); $comments_count = get_comments( $args );