Changeset 11890 for trunk/src/bp-activity/classes/class-bp-akismet.php
- Timestamp:
- 03/05/2018 04:54:39 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/classes/class-bp-akismet.php
r10516 r11890 412 412 // Mark as spam. 413 413 bp_activity_mark_as_spam( $activity, 'by_akismet' ); 414 415 if ( 416 Akismet::allow_discard() && 417 ! empty( $activity_data['bp_as_result_headers']['X-akismet-pro-tip'] ) && 418 $activity_data['bp_as_result_headers']['X-akismet-pro-tip'] === 'discard' 419 ) { 420 // If this is so spammy it's not worth your time, let's just delete it. 421 if ( $activity->type === 'activity_comment' ) { 422 bp_activity_delete_comment( $activity->item_id, $activity->id ); 423 } else { 424 bp_activity_delete( array( 'id' => $activity->id ) ); 425 } 426 } 414 427 } 415 428 … … 547 560 remove_filter( 'akismet_ua', array( $this, 'buddypress_ua' ) ); 548 561 562 $activity_data['bp_as_result_headers'] = array(); 563 $activity_data['bp_as_result'] = ''; 564 549 565 // Get the response. 550 if ( ! empty( $response[1] ) && ! is_wp_error( $response[1] ) ) 551 $activity_data['bp_as_result '] = $response[1];552 else553 $activity_data['bp_as_result'] = false;566 if ( ! empty( $response[1] ) && ! is_wp_error( $response[1] ) ) { 567 $activity_data['bp_as_result_headers'] = $response[0]; 568 $activity_data['bp_as_result'] = $response[1]; 569 } 554 570 555 571 // Perform a daily tidy up.
Note: See TracChangeset
for help on using the changeset viewer.