File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,9 @@ public function comment_form_fields() {
53
53
public function check_comment_policy ( $ comment_data ) {
54
54
// phpcs:ignore WordPress.Security.NonceVerification.Missing -- Comment forms (unfortunately) are always without nonces.
55
55
if ( ! isset ( $ _POST ['comment_policy ' ] ) || ! ( $ _POST ['comment_policy ' ] === 'on ' || $ _POST ['comment_policy ' ] === true ) ) {
56
- \wp_die ( \esc_html ( $ this ->options ['comment_policy_error ' ] ) . '<br /><br /><a href="javascript:history.go(-1);"> ' . \esc_html__ ( 'Go back and try again. ' , 'comment-hacks ' ) . '</a> ' );
56
+ if ( ! \current_user_can ( 'moderate_comments ' ) ) {
57
+ \wp_die ( \esc_html ( $ this ->options ['comment_policy_error ' ] ) . '<br /><br /><a href="javascript:history.go(-1);"> ' . \esc_html__ ( 'Go back and try again. ' , 'comment-hacks ' ) . '</a> ' );
58
+ }
57
59
}
58
60
59
61
return $ comment_data ;
You can’t perform that action at this time.
0 commit comments