Coding Standards: Rename the $object variable to $attachment in several files.

This brings some consistency with a similar fragment in `Custom_Image_Heade::step_2_manage_upload()`, `WP_Site_Icon::insert_attachment()`, `media_handle_upload()`, and clarifies the type of the data.

Follow-up to [52946], [53137].

See #55327, #54728.

git-svn-id: https://develop.svn.wordpress.org/trunk@53183 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2022-04-14 15:13:45 +00:00
parent ef821da26b
commit c79cc90ad0
5 changed files with 21 additions and 21 deletions
@@ -510,8 +510,8 @@ class Custom_Background {
$file = $file['file'];
$filename = wp_basename( $file );
// Construct the object array.
$object = array(
// Construct the attachment array.
$attachment = array(
'post_title' => $filename,
'post_content' => $url,
'post_mime_type' => $type,
@@ -520,7 +520,7 @@ class Custom_Background {
);
// Save the data.
$id = wp_insert_attachment( $object, $file );
$id = wp_insert_attachment( $attachment, $file );
// Add the metadata.
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );