File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/wp-includes/rest-api/endpoints Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1890,6 +1890,10 @@ protected function check_read_post_permission( $post, $request ) {
18901890 * @return bool Whether the comment can be read.
18911891 */
18921892 protected function check_read_permission ( $ comment , $ request ) {
1893+ if ( 0 === get_current_user_id () ) {
1894+ return false ;
1895+ }
1896+
18931897 if ( ! empty ( $ comment ->comment_post_ID ) ) {
18941898 $ post = get_post ( $ comment ->comment_post_ID );
18951899 if ( $ post ) {
@@ -1899,10 +1903,6 @@ protected function check_read_permission( $comment, $request ) {
18991903 }
19001904 }
19011905
1902- if ( 0 === get_current_user_id () ) {
1903- return false ;
1904- }
1905-
19061906 if ( empty ( $ comment ->comment_post_ID ) && ! current_user_can ( 'moderate_comments ' ) ) {
19071907 return false ;
19081908 }
You can’t perform that action at this time.
0 commit comments