Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#60103 closed defect (bug) (wontfix)

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

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

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 3 years ago.

Download all attachments as: .zip

Change History (3)

@upadalavipul
3 years ago

#1 @SergeyBiryukov
3 years ago

  • Component GeneralMedia
  • 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
3 years ago

  • Milestone Awaiting Review
  • Resolutionwontfix
  • Status newclosed

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

Note: See TracTickets for help on using tickets.