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.
Built from https://develop.svn.wordpress.org/trunk@59915


git-svn-id: http://core.svn.wordpress.org/trunk@59257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2025-03-03 20:59:21 +00:00
parent 3e3b488116
commit 6a904137d2
2 changed files with 2 additions and 2 deletions

View File

@@ -2071,7 +2071,7 @@ function wp_insert_comment( $commentdata ) {
$id = (int) $wpdb->insert_id; $id = (int) $wpdb->insert_id;
if ( 1 == $comment_approved ) { if ( 1 === (int) $comment_approved ) {
wp_update_comment_count( $comment_post_id ); wp_update_comment_count( $comment_post_id );
$data = array(); $data = array();

View File

@@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.8-alpha-59914'; $wp_version = '6.8-alpha-59915';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.