Skip to main content
added 116 characters in body
Source Link
birgire
  • 68.1k
  • 7
  • 121
  • 255

You can try to stop it in the pre_comment_on_post hook

add_action('pre_comment_on_post', 'no_wp_comments'); function no_wp_comments() { wp_die('No comments'); } 

I use this when I use Facebook comments instead of Wordpress comments.

Here is a similar example with an anonymous function:

add_action('pre_comment_on_post', create_function( '','wp_die("No comments");')); 

but I prefer the first example, it's easier to modify.

This hook is in the file wp-comments-post.php as:

do_action('pre_comment_on_post', $comment_post_ID); 

You can try to stop it in the pre_comment_on_post hook

add_action('pre_comment_on_post', 'no_wp_comments'); function no_wp_comments() { wp_die('No comments'); } 

I use this when I use Facebook comments instead of Wordpress comments.

Here is a similar example with an anonymous function:

add_action('pre_comment_on_post', create_function( '','wp_die("No comments");')); 

but I prefer the first example, it's easier to modify.

You can try to stop it in the pre_comment_on_post hook

add_action('pre_comment_on_post', 'no_wp_comments'); function no_wp_comments() { wp_die('No comments'); } 

I use this when I use Facebook comments instead of Wordpress comments.

Here is a similar example with an anonymous function:

add_action('pre_comment_on_post', create_function( '','wp_die("No comments");')); 

but I prefer the first example, it's easier to modify.

This hook is in the file wp-comments-post.php as:

do_action('pre_comment_on_post', $comment_post_ID); 
added 204 characters in body
Source Link
birgire
  • 68.1k
  • 7
  • 121
  • 255

You can try to stop it in the pre_comment_on_post hook

add_action('pre_comment_on_post', 'no_wp_comments'); function no_wp_comments() { wp_die('No comments'); } 

I use this when I use Facebook comments instead of Wordpress comments.

Here is a similar example with an anonymous function:

add_action('pre_comment_on_post', create_function( '','wp_die("No comments");')); 

but I prefer the first example, it's easier to modify.

You can try to stop it in the pre_comment_on_post hook

add_action('pre_comment_on_post', 'no_wp_comments'); function no_wp_comments() { wp_die('No comments'); } 

I use this when I use Facebook comments instead of Wordpress comments.

You can try to stop it in the pre_comment_on_post hook

add_action('pre_comment_on_post', 'no_wp_comments'); function no_wp_comments() { wp_die('No comments'); } 

I use this when I use Facebook comments instead of Wordpress comments.

Here is a similar example with an anonymous function:

add_action('pre_comment_on_post', create_function( '','wp_die("No comments");')); 

but I prefer the first example, it's easier to modify.

Source Link
birgire
  • 68.1k
  • 7
  • 121
  • 255

You can try to stop it in the pre_comment_on_post hook

add_action('pre_comment_on_post', 'no_wp_comments'); function no_wp_comments() { wp_die('No comments'); } 

I use this when I use Facebook comments instead of Wordpress comments.