custom_comment_status.patch
Index: [wp](http://codex.wordpress.org/Plugin_API/Action_Reference/wp)-includes/comment.php
===================================================================
--- [wp](http://codex.wordpress.org/Plugin_API/Action_Reference/wp)-includes/comment.php 2016-01-02 03:35:21.000000000 +0000
+++ [wp](http://codex.wordpress.org/Plugin_API/Action_Reference/wp)-includes/comment.php 2016-01-14 11:13:31.500864921 +0000
@@ -240,7 +240,7 @@
'trash' => [_x](http://codex.wordpress.org/Function_Reference/_x)('Trash', 'adjective'),
);
- return $status;
+ return [apply_filters](http://codex.wordpress.org/Function_Reference/apply_filters) ( 'get_comment_statuses', $status );
}
/**
@@ -1327,7 +1327,7 @@
elseif ( $approved == 'trash' )
return 'trash';
else
- return false;
+ return [apply_filters](http://codex.wordpress.org/Function_Reference/apply_filters) ( '[wp_get_comment_status](http://codex.wordpress.org/Function_Reference/wp_get_comment_status)', false, $comment );
}
/**
@@ -1847,7 +1847,12 @@
$status = 'trash';
break;
default:
- return false;
+ $status = [apply_filters](http://codex.wordpress.org/Function_Reference/apply_filters) ( '[wp_set_comment_status](http://codex.wordpress.org/Function_Reference/wp_set_comment_status)', false, $comment );
+ break;
+ }
+
+ if ( false === $status ) {
+ return false;
}
$comment_old = clone [get_comment](http://codex.wordpress.org/Function_Reference/get_comment)($[comment_ID](http://codex.wordpress.org/Function_Reference/comment_ID));