Make WordPress Core

Opened 8 months ago

Closed 6 months ago

#60103 closed defect (bug) (wontfix)

Unused $body_id variable on the media-upload.php file.

Reported by: upadalavipul's profile upadalavipul Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Media Keywords: close
Focuses: administration, coding-standards Cc:

Description

I have reviewed the media.php file code and found the $body_id variable is unused. So I think as per the coding standard we need to remove the $body_id variable here.

files: wp-admin/media-upload.php

Attachments (1)

60103.patch (445 bytes) - added by upadalavipul 8 months ago.

Download all attachments as: .zip

Change History (3)

@upadalavipul
8 months ago

#1 @SergeyBiryukov
8 months ago

  • Component changed from General to Media
  • Focuses administration added
  • Keywords close added

Hi there, thanks for the patch!

The $body_id global is used in wp_iframe() and iframe_header().

wp_media_upload_handler() calls wp_iframe() with media_upload_type_form() as a callback printing the content, which in turn loads the media-upload.php file where $body_id is defined.

These are legacy media functions, but they are still kept for backward compatibility, so I don't think the $body_id global should be removed, as that might cause unnecessary breakage.

#2 @sabernhardt
6 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

The global is used by functions in other files, so I'll close the ticket.

Note: See TracTickets for help on using tickets.