diff --git wp-includes/comment-functions.php wp-includes/comment-functions.php
index 261a1f4..f238354 100644
|
|
|
function wp_handle_comment_submission( $comment_data ) { |
| 2657 | 2657 | } elseif ( 'trash' == $status ) { |
| 2658 | 2658 | |
| 2659 | 2659 | /** |
| 2660 | | * Fires when a comment is attempted on a trashed post. |
| | 2660 | * Allow comments on trashed posts. |
| 2661 | 2661 | * |
| 2662 | | * @since 2.9.0 |
| | 2662 | * Allow comments on trashed posts, per #19739. |
| 2663 | 2663 | * |
| 2664 | | * @param int $comment_post_ID Post ID. |
| | 2664 | * @since 4.4.0 |
| | 2665 | * |
| | 2666 | * @param bool $allow_comments_on_trash Whether to allow comments on trashed posts |
| | 2667 | * @param int $comment_post_ID The post_id for comments to be enabled on. |
| 2665 | 2668 | */ |
| 2666 | | do_action( 'comment_on_trash', $comment_post_ID ); |
| | 2669 | if ( ! apply_filters( 'allow_comment_on_trash', false, $comment_post_ID ) ) { |
| 2667 | 2670 | |
| 2668 | | return new WP_Error( 'comment_on_trash' ); |
| | 2671 | /** |
| | 2672 | * Fires when a comment is attempted on a trashed post. |
| | 2673 | * |
| | 2674 | * @since 2.9.0 |
| | 2675 | * |
| | 2676 | * @param int $comment_post_ID Post ID. |
| | 2677 | */ |
| | 2678 | do_action( 'comment_on_trash', $comment_post_ID ); |
| 2669 | 2679 | |
| | 2680 | return new WP_Error( 'comment_on_trash' ); |
| | 2681 | } |
| 2670 | 2682 | } elseif ( ! $status_obj->public && ! $status_obj->private ) { |
| 2671 | 2683 | |
| 2672 | 2684 | /** |
| 2673 | | * Fires when a comment is attempted on a post in draft mode. |
| | 2685 | * Allow comments on draft posts. |
| 2674 | 2686 | * |
| 2675 | | * @since 1.5.1 |
| | 2687 | * Allow comments on draft posts, per #19739. |
| 2676 | 2688 | * |
| 2677 | | * @param int $comment_post_ID Post ID. |
| | 2689 | * @since 4.4.0 |
| | 2690 | * |
| | 2691 | * @param bool $allow_comments_on_draft Whether to allow comments on draft posts |
| | 2692 | * @param int $comment_post_ID The post_id for comments to be enabled on. |
| 2678 | 2693 | */ |
| 2679 | | do_action( 'comment_on_draft', $comment_post_ID ); |
| | 2694 | if ( ! apply_filters( 'allow_comment_on_draft', false, $comment_post_ID ) ) { |
| 2680 | 2695 | |
| 2681 | | return new WP_Error( 'comment_on_draft' ); |
| | 2696 | /** |
| | 2697 | * Fires when a comment is attempted on a post in draft mode. |
| | 2698 | * |
| | 2699 | * @since 1.5.1 |
| | 2700 | * |
| | 2701 | * @param int $comment_post_ID Post ID. |
| | 2702 | */ |
| | 2703 | do_action( 'comment_on_draft', $comment_post_ID ); |
| 2682 | 2704 | |
| | 2705 | return new WP_Error( 'comment_on_draft' ); |
| | 2706 | } |
| 2683 | 2707 | } elseif ( post_password_required( $comment_post_ID ) ) { |
| 2684 | 2708 | |
| 2685 | 2709 | /** |