Skip to main content
edited tags
Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459
Source Link
JMau
  • 2.9k
  • 5
  • 20
  • 27

Limit action in comment according to IP

I've been trying to set something that might be really easy (but I never had to do this before) :

add_filter('pre_comment_user_ip', 'limit_commentator');
function limit_commentator( $comment ) {
    $comment_field_value = get_comment_meta( $comment->comment_ID, 'some_custom_field', true );
    //my code
    
}

I think this is the right hook but how can I limit the ability for commentators to post comment WITH this custom field? Actually I just want one value per IP.

Got another question : Is it really worthy to limit per IP? I've been thinking about a limit on a daily basis. What do you think about this?