Skip to content

Commit 369d2e7

Browse files
johnbillionCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 280454f commit 369d2e7

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/wp-includes/class-wpdb.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2568,7 +2568,7 @@ public function insert( $table, $data, $format = null ) {
25682568
* format is ignored in this case.
25692569
* @param string[] $format Optional. An array of formats to be mapped to each of the values in each row.
25702570
* A format is one of '%d', '%f', '%s' (integer, float, string).
2571-
* If omitted, all values in `$data` will be treated as strings unless otherwise
2571+
* If omitted, all values in `$rows` will be treated as strings unless otherwise
25722572
* specified in wpdb::$field_types. Default empty array.
25732573
* @return int|false The number of rows inserted, or false on error.
25742574
*/

src/wp-includes/meta.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function bulk_add_metadata( string $meta_type, int $object_id, array $meta_field
228228
$added_keys = array();
229229

230230
foreach ( $meta_fields as $meta_key => $meta_value ) {
231-
// expected_slashed ($meta_key)
231+
// expected_slashed ($meta_key, $meta_value)
232232
$meta_key = wp_unslash( $meta_key );
233233
$meta_value = wp_unslash( $meta_value );
234234
$meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type, $meta_subtype );
@@ -279,9 +279,9 @@ function bulk_add_metadata( string $meta_type, int $object_id, array $meta_field
279279
wp_cache_delete( $object_id, $meta_type . '_meta' );
280280

281281
foreach ( $data as $datum ) {
282-
list( $object_id, $meta_key, $meta_value ) = $datum;
282+
list( $row_object_id, $meta_key, $meta_value ) = $datum;
283283
/** This action is documented in wp-includes/meta.php */
284-
do_action( "added_{$meta_type}_meta", $all_mids[ $meta_key ], $object_id, $meta_key, $meta_value );
284+
do_action( "added_{$meta_type}_meta", $all_mids[ $meta_key ], $row_object_id, $meta_key, $meta_value );
285285
}
286286

287287
return $all_mids;

src/wp-includes/ms-site.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ function add_site_meta( $site_id, $meta_key, $meta_value, $unique = false ) {
10681068
* @return array<string,int>|false Array of meta IDs keyed by their meta key on success, false on failure.
10691069
*/
10701070
function bulk_add_site_meta( int $site_id, array $meta_fields ) {
1071-
return bulk_add_metadata( 'site', $site_id, $meta_fields );
1071+
return bulk_add_metadata( 'blog', $site_id, $meta_fields );
10721072
}
10731073

10741074
/**

0 commit comments

Comments
 (0)