Make WordPress Core

Opened 3 months ago

Last modified 2 months ago

#63157 new defect (bug)

wp_list_comments behaves differently when passed string or array

Reported by: john_w_b's profile John_W_B Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.7.2
Component: Comments Keywords:
Focuses: Cc:

Description

  1. Set up Discussion so that comment does not require manual approval.
  2. Put function in functions.php which prints 'your commment is waiting approval' if
     $comment->comment_approved == '0'.
    

and which prints the comment.

  1. call that function in the theme's comment template comments.php

Result: in 6.7.1 if the function is passed as a string, e.g.

wp_list_comments("callback=my_function")

or if it is passed as an array

wp_list_comments(["callback"=>"my_function"])

Behaviour is the same.

Comments are not published unless {{{

$comment->comment_approved == '1'.

}}}

This changed in 6.7.2. Now, if the callback is passed as a string, comments are published even if {{{

$comment->comment_approved == '0'.

}}}

However, now if the callback ias passed an array, comments are not published if {{{

$comment->comment_approved == '0'.

}}}

I cannot see what has caused this change.

Change History (1)

#1 @debarghyabanerjee
2 months ago

Last edited 2 months ago by debarghyabanerjee (previous) (diff)
Note: See TracTickets for help on using tickets.