diff -r be944660c56a -r 3d72ae0968f4 wp/wp-admin/includes/class-wp-site-icon.php --- a/wp/wp-admin/includes/class-wp-site-icon.php Wed Sep 21 18:19:35 2022 +0200 +++ b/wp/wp-admin/includes/class-wp-site-icon.php Tue Sep 27 16:37:53 2022 +0200 @@ -80,7 +80,7 @@ * * @param string $cropped Cropped image URL. * @param int $parent_attachment_id Attachment ID of parent image. - * @return array Attachment object. + * @return array An array with attachment object data. */ public function create_attachment_object( $cropped, $parent_attachment_id ) { $parent = get_post( $parent_attachment_id ); @@ -90,7 +90,7 @@ $size = wp_getimagesize( $cropped ); $image_type = ( $size ) ? $size['mime'] : 'image/jpeg'; - $object = array( + $attachment = array( 'ID' => $parent_attachment_id, 'post_title' => wp_basename( $cropped ), 'post_content' => $url, @@ -99,7 +99,7 @@ 'context' => 'site-icon', ); - return $object; + return $attachment; } /** @@ -107,12 +107,12 @@ * * @since 4.3.0 * - * @param array $object Attachment object. - * @param string $file File path of the attached image. - * @return int Attachment ID + * @param array $attachment An array with attachment object data. + * @param string $file File path of the attached image. + * @return int Attachment ID. */ - public function insert_attachment( $object, $file ) { - $attachment_id = wp_insert_attachment( $object, $file ); + public function insert_attachment( $attachment, $file ) { + $attachment_id = wp_insert_attachment( $attachment, $file ); $metadata = wp_generate_attachment_metadata( $attachment_id, $file ); /**