bb_ksd_delete_post

The BuddyPress bb ksd delete post function.

Description

bb_ksd_delete_post( $post_id, $new_status, $old_status ); 

Parameters (3)

0. $post_id
The post id.
1. $new_status
The new status.
2. $old_status
The old status.

Usage

  1. if ( !function_exists( 'bb_ksd_delete_post' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-plugins/akismet.php'; 
  3.  
  4. // The post id. 
  5. $post_id = null; 
  6.  
  7. // The new status. 
  8. $new_status = null; 
  9.  
  10. // The old status. 
  11. $old_status = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bb_ksd_delete_post($post_id, $new_status, $old_status); 
  15.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bbpress/bb-plugins/akismet.php  
  1. function bb_ksd_delete_post( $post_id, $new_status, $old_status ) 
  2. // Don't report post deletion 
  3. if ( 1 == $new_status ) { 
  4. return; 
  5. // Don't report no change in post status 
  6. if ( $new_status == $old_status ) { 
  7. return; 
  8. // It's being marked as spam, so report it 
  9. if ( 2 == $new_status ) { 
  10. bb_ksd_submit_spam( $post_id ); 
  11. return; 
  12. // It's not spam (and not being deleted), so it's ham now 
  13. if ( 2 == $old_status ) { 
  14. bb_ksd_submit_ham( $post_id ); 
  15. return;