Ticket #30091: 30091.diff
| File 30091.diff, 1.7 KB (added by , 11 years ago) |
|---|
-
src/wp-comments-post.php
58 58 */ 59 59 do_action( 'comment_on_trash', $comment_post_ID ); 60 60 exit; 61 } elseif ( ! $status_obj->public && ! $status_obj->private ) {62 /**63 * Fires when a comment is attempted on a post in draft mode.64 *65 * @since 1.5.166 *67 * @param int $comment_post_ID Post ID.68 */69 do_action( 'comment_on_draft', $comment_post_ID );70 exit;71 61 } elseif ( post_password_required( $comment_post_ID ) ) { 72 62 /** 73 63 * Fires when a comment is attempted on a password-protected post. … … 79 69 do_action( 'comment_on_password_protected', $comment_post_ID ); 80 70 exit; 81 71 } else { 82 /** 83 * Fires before a comment is posted. 84 * 85 * @since 2.8.0 86 * 87 * @param int $comment_post_ID Post ID. 88 */ 89 do_action( 'pre_comment_on_post', $comment_post_ID ); 72 if ( ! $status_obj->public && ! $status_obj->private && current_user_can( 'edit_posts') ) { 73 74 /** 75 * Fires when a comment is attempted on a post in draft mode. 76 * 77 * @since 1.5.1 78 * 79 * @param int $comment_post_ID Post ID. 80 */ 81 do_action( 'comment_on_draft', $comment_post_ID ); 82 83 /** 84 * Fires before a comment is posted. 85 * 86 * @since 2.8.0 87 * 88 * @param int $comment_post_ID Post ID. 89 */ 90 do_action( 'pre_comment_on_post', $comment_post_ID ); 91 } else { 92 do_action( 'pre_comment_on_post', $comment_post_ID ); 93 } 90 94 } 91 95 92 96 $comment_author = ( isset($_POST['author']) ) ? trim(strip_tags($_POST['author'])) : null;