-if ( empty($status->comment_status) ) {
- do_action('comment_id_not_found', $comment_post_ID);
+if ( ! comments_open( $comment_post_ID ) ) {
+ /**
+ * Fires when a comment is attempted on a post that has comments closed.
+ *
+ * @since 1.5.0
+ *
+ * @param int $comment_post_ID Post ID.
+ */
+ do_action( 'comment_closed', $comment_post_ID );
+ wp_die( __( 'Sorry, comments are closed for this item.' ), 403 );
+} elseif ( 'trash' == $status ) {
+ /**
+ * Fires when a comment is attempted on a trashed post.
+ *
+ * @since 2.9.0
+ *
+ * @param int $comment_post_ID Post ID.
+ */
+ do_action( 'comment_on_trash', $comment_post_ID );