mirror of
git://develop.git.wordpress.org/
synced 2025-03-20 20:09:53 +01:00
Coding Standards: Use strict comparison in wp_insert_comment()
.
Includes type casting `$comment_approved` to an integer to avoid breaking WP-CLI tests, since the value can be passed as a string. Follow-up to [3104], [3193], [3887], [59903]. Props swissspidy. See #62279. git-svn-id: https://develop.svn.wordpress.org/trunk@59915 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8731d62dc7
commit
04b6524cb0
@ -2071,7 +2071,7 @@ function wp_insert_comment( $commentdata ) {
|
||||
|
||||
$id = (int) $wpdb->insert_id;
|
||||
|
||||
if ( 1 == $comment_approved ) {
|
||||
if ( 1 === (int) $comment_approved ) {
|
||||
wp_update_comment_count( $comment_post_id );
|
||||
|
||||
$data = array();
|
||||
|
Loading…
x
Reference in New Issue
Block a user