The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
set a max limit of ...
 
Notifications
Clear all

set a max limit of comments that a post can get

2 Posts
2 Users
0 Reactions
1,492 Views
(@edumetiscom)
Posts: 1
New Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
[#1979]

Hello, I’ve been enjoying the plugin a lot. especially the private comments. I’m trying to add a feature to plugin. I want the posts to be closed after that post had 5 comments. I want every post in the website to have maximum of 5 comments. after 5 comments, I want to hide comment form to be closed to users. to achieve this I used the code below, but there is a problem. this code closes to comment for admins but not to other users. how can I achieve this goal? Thank you in advance. Cheers. Baris

add_filter("wpdiscuz_form_render", function ($output, $commentsCount, $currentUser) {
    global $post;
   if ($commentcount = get_comments_number( $post->ID )>4) {
      $output = "You can't comment on this post since It already has 5 comments";
   }
   return $output;
}, 10, 3);

 
Posted : 22/04/2021 3:34 pm
Asti
 Asti
(@asti)
Posts: 8267
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@edumetiscom,

The code works fine. We've checked it several times. 

Please send the admin login details to info[at]gvectors.com email address. I'll ask the developers to check the issue for you. 


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 22/04/2021 4:19 pm