The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
How limit Comments ...
 
Share:
Notifications
Clear all

[Solved] How limit Comments number per user in specific period time

4 Posts
2 Users
0 Reactions
861 Views
Posts: 2
Topic starter
(@abdoo22)
New Member
Joined: 2 years ago

i need to limit numbers of comments user can post per time

as example: user can post only one comment / 24Hours

i try following function code

"function dam_the_flood( $dam_it, $time_last, $time_new ) {
if ( ($time_new - $time_last) < 86001 ) // time interval is 86001
return true; // seconds
return false;
}
add_filter('comment_flood_filter', 'dam_the_flood', 10, 3);"

Β 

it works with other website not use wp-discuz

but not with wp-discus

i hope can fix that issue

thanks

3 Replies
Asti
Posts: 7617
 Asti
Support
(@asti)
Illustrious Member
Joined: 7 years ago

Hi @abdoo22,

Please check out the wpDiscuz "Limit Comments per User" option. It's located in the Dashboard > wpDiscuz > Settings > Comment Moderation admin page.Β 

More info here: https://wpdiscuz.com/docs/wpdiscuz-7/plugin-settings/comment-moderation/#limit-comments-per-user

Posts: 2
Topic starter
(@abdoo22)
New Member
Joined: 2 years ago

Hello,

thank you for replay

i know this option but it limit comments for user lifetime

i need to limit for some times

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7617

@abdoo22,Β 

You can use the wpdiscuz_form_render hook. More info here: https://wpdiscuz.com/docs/codex/filters/wpdiscuz_form_render/ Β 

Share: