Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#6181 closed defect (bug) (fixed)

There is no way to edit an attachment

Reported by: mdawaffe Owned by:
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.5
Component: General Keywords: has-patch needs-testing
Focuses: Cc:


Currently, you can only edit an attachment via the Write Post page. This patch adds a means to "Edit Media" under the Manage section.

A new file, wp-admin/media.php is added as our media object jumping off point like post.php, comment.php, etc. Eventually, it'd be nice if all the delete, upload, edit, etc. links pointed to this file which then dispatched to the correct functions/templates.

We can move this functionality to upload.php if people want. The idea here was to be parallel with the rest of our "noun" files. ("medium.php" sounded dumb. We could do "attachment.php".)

get_media_item() is used to output the edit form, but the HTML/CSS has been tweaked to be a bit more flexible and a bit less table-centric (with negligible changes to the visual output for the iframed content on the Write page).

The basic JS form validation that wp-lists uses has been better abstracted and can now be used on any page.

get_edit_post_link() and friends point to the correct edit form for pages, posts, attachments.

Aditionally, the patch removes some debug code in script-loader.php (mt_rand() calls).

Tested on FF2 only.

Attachments (1)

6181.diff (24.5 KB) - added by mdawaffe 6 years ago.

Download all attachments as: .zip

Change History (3)

mdawaffe6 years ago

comment:1 ryan6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [7262]) Attachment editing from mdawaffe. fixes #6181

comment:2 ryan6 years ago

Worked well for me with FF and Safari.

Note: See TracTickets for help on using tickets.