Ticket #7531: akismet_die_on_spam.diff
| File akismet_die_on_spam.diff, 1.5 KB (added by ozh, 5 years ago) |
|---|
-
akismet.php
5 5 Description: Akismet checks your comments against the Akismet web service to see if they look like spam or not. You need a <a href="http://wordpress.com/api-keys/">WordPress.com API key</a> to use it. You can review the spam it catches under "Comments." To show off your Akismet stats just put <code><?php akismet_counter(); ?></code> in your template. See also: <a href="http://wordpress.org/extend/plugins/stats/">WP Stats plugin</a>. 6 6 Version: 2.1.6 7 7 Author: Matt Mullenweg 8 Author URI: http:// photomatt.net/8 Author URI: http://ma.tt/ 9 9 */ 10 10 11 11 // If you hardcode a WP.com API key here, all key config screens will be hidden … … 203 203 $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port); 204 204 if ( 'true' == $response[1] ) { 205 205 add_filter('pre_comment_approved', create_function('$a', 'return \'spam\';')); 206 add_filter('comment_post_redirect', 'akismet_reject_screen'); 206 207 update_option( 'akismet_spam_count', get_option('akismet_spam_count') + 1 ); 207 208 208 209 do_action( 'akismet_spam_caught' ); … … 219 220 return $comment; 220 221 } 221 222 223 function akismet_reject_screen() { 224 header('HTTP/1.1 403 Forbidden'); 225 wp_die(__('Sorry, your comment was considered as spam and rejected')); 226 } 227 222 228 function akismet_delete_old() { 223 229 global $wpdb; 224 230 $now_gmt = current_time('mysql', 1);
