[wp-trac] [WordPress Trac] #22664: attachment_fields_to_edit: parameter missing indexes

WordPress Trac noreply at wordpress.org
Sun Dec 2 22:49:46 UTC 2012


#22664: attachment_fields_to_edit: parameter missing indexes
-------------------------------------------+------------------------------
 Reporter:  ZaneMatthew                    |       Owner:
     Type:  defect (bug)                   |      Status:  new
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  Media                          |     Version:  trunk
 Severity:  normal                         |  Resolution:
 Keywords:  needs-patch reporter-feedback  |
-------------------------------------------+------------------------------

Comment (by nacin):

 attachment_fields_to_edit takes a different set of arguments than what
 you're saying: $form_fields and $post. form_fields is a multidimensional
 associative array that describes each field. $post is a standard post
 object of the attachment.

 attachment_fields_to_edit no longer contains the standard fields,
 including image-size, align, image_alt, post_title, post_excerpt, url,
 menu_order, post_content, and image_url, because these are now rendered
 using media views. So, these fields are simply not passed to the filter.
 You can however continue to add form_fields if you'd like.

 attachment_fields_to_save does still run, via Ajax. Again, it no longer
 acts on any standard fields I mentioned above. It is simply there for
 existing hooks to modify any fields that a plugin added via
 attachment_fields_to_edit.

 attachment_fields_to_save *does* take a $post and an $attachment array, as
 before.

 I don't think there is anything you need to do to adjust your code — but I
 can't tell you that for certain if you don't supply your code.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22664#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list