bb_ksd_bulk_post__action

The WordPress Core bb ksd bulk post action function.

Description

bb_ksd_bulk_post__action( $query_vars, $post_ids, $action ); 

Parameters (3)

0. $query_vars
The query vars.
1. $post_ids
The post ids.
2. $action
The action.

Usage

  1. if ( !function_exists( 'bb_ksd_bulk_post__action' ) ) { 
  2. require_once '/bp-forums/bbpress/bb-plugins/akismet.php'; 
  3.  
  4. // The query vars. 
  5. $query_vars = null; 
  6.  
  7. // The post ids. 
  8. $post_ids = null; 
  9.  
  10. // The action. 
  11. $action = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bb_ksd_bulk_post__action($query_vars, $post_ids, $action); 
  15.  

Defined (1)

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

/bp-forums/bbpress/bb-plugins/akismet.php  
  1. function bb_ksd_bulk_post__action( $query_vars, $post_ids, $action ) { 
  2. $count = 0; 
  3.  
  4. switch ( $action ) { 
  5. case 'spam' : 
  6. foreach ( $post_ids as $post_id ) { 
  7. $count += (int) (bool) bb_delete_post( $post_id, 2 ); 
  8. return array( 'message' => 'spammed', 'count' => $count ); 
  9. case 'unspam' : 
  10. foreach ( $post_ids as $post_id ) { 
  11. $count += (int) (bool) bb_delete_post( $post_id, 0 ); 
  12. return array( 'message' => 'unspammed-normal', 'count' => $count );