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

WordPress Trac noreply at wordpress.org
Sat Dec 1 00:12:39 UTC 2012


#22664: attachment_fields_to_save: 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   |
--------------------------+------------------------------

Comment (by nacin):

 attachment_fields_to_save is a fairly interesting hook. It gets a $post
 and returns a $post. It also gets a bunch of $attachment data that was
 posted with the form. The bug report is referring to that $attachment
 data.

 Most plugins are going to hook into attachment_fields_to_save, grab their
 field's value from $attachment, and do one of two things: add it to $post,
 or more likely, insert post metadata. Not having post_content, post_title,
 etc., in $attachment shouldn't really matter for this.

 That said, you may be using those other fields for context. It's a fairly
 rare use case, but it is certainly possible.

 In the interest in offering full backwards compatibility in 3.5 in the
 waning days of the release cycle, I'm definitely inclined to send all non-
 compat fields (title, alt, caption/excerpt, etc.) to save-attachment-
 compat, even though they will be unused, for the purposes of context.

 Zane, could you provide some code that you were using that breaks under
 RC2? Or was this just something you noticed?

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


More information about the wp-trac mailing list