[wp-trac] [WordPress Trac] #28053: Fields with same name added to new media modal using 'attachment_fields_to_edit' do not pass as an array when saving.

WordPress Trac noreply at wordpress.org
Wed Oct 15 08:30:00 UTC 2014


#28053: Fields with same name added to new media modal using
'attachment_fields_to_edit' do not pass as an array when saving.
-------------------------------+-----------------------------------------
 Reporter:  husobj             |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Media              |     Version:  3.5
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  javascript, administration
-------------------------------+-----------------------------------------

Comment (by husobj):

 Download this plugin which sets up attachment tag and category taxonomies.
 https://github.com/benhuson/attachment-taxonomy-support/tree/dev

 In Admin > Media set up some tags and categories.
 If you edit a media item (from the list view, not the modal popup in 4.0)
 you'll get the default taxonomy UI meta boxes which work fine.

 If you get into the media modal either via the WP 4.0 Grid view or
 clicking on "Add Media" when editing a post, you'll see the modal now
 shows a field for tags and category checkboxes.

 The tags field is named in the format
 "attachments[{attachment_id}][attachment_tag]" and this autosaves fine
 when the field is updated.

 With the checkboxes, I was expecting to be able to name them all in the
 format "attachments[{attachment_id}][attachment_category][]" and the "[]"
 on the end would signify the values get submitted as an array and saved
 (like the checkboxes in the standard categories meta box).

 That currently isn't working and is the use case I am trying to fix.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28053#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list