Advertisement
ozh

Untitled

ozh
Sep 7th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. <?php
  2.  
  3. function ozh_delete( $cid ) {
  4.     $result = wp_delete_comment( $cid, $force ); // true or false
  5. }
  6.  
  7. function ozh_trash( $cid ) {
  8.     $result = wp_trash_comment( $cid ); // true or false
  9. }
  10.  
  11. function ozh_untrash( $cid ) {
  12.     $result = wp_untrash_comment( $cid ); // true or false
  13. }
  14.  
  15. function ozh_spam( $cid ) {
  16.     $result = wp_spam_comment( $cid ); // true or false
  17. }
  18.  
  19. function ozh_unspam( $cid ) {
  20.     $result = wp_unspam_comment( $cid ); // true or false
  21. }
  22.  
  23. function ozh_approve( $comment_id ) {
  24.     wp_set_comment_status( $comment_id, 'approve', true ); // true or error message
  25. }
  26.  
  27. function ozh_unapprove( $comment_id ) {
  28.     wp_set_comment_status( $comment_id, 'hold', true ); // true or error message
  29. }
  30.  
  31. function ozh_status( $cid ) {
  32.     $result = wp_get_comment_status( $cid ); // approved, unapproved, spam, trash, or false on failure
  33.     return $result;
  34. }
  35.  
  36. function ozh_count( $post_id = 0 ) {
  37.     $result = wp_count_comments( $post_id );
  38.     return $result;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement