[wp-trac] [WordPress Trac] #22186: Backwards compatibility for admin/includes/media.php hooks

WordPress Trac noreply at wordpress.org
Mon Nov 26 23:48:23 UTC 2012


#22186: Backwards compatibility for admin/includes/media.php hooks
--------------------------+------------------
 Reporter:  nacin         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  low           |   Milestone:  3.5
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------

Comment (by bbrooks):

 In the new media UI, custom fields added by hooking into:
 'attachment_fields_to_edit' do not get submitted with a nonce, fail ajax
 verification, and thus do not retain any information entered by the user.

 Here's the ajax form data being submitted for the custom fields:

 '''action''':save-attachment-compat[[BR]]
 '''id''':5555[[BR]]
 '''attachments[5555][name_of_custom_field]''':sample custom field text


 Compare this to the same submit for the 'alt' field of an image:

 '''action''':save-attachment[[BR]]
 '''id''':5555[[BR]]
 '''nonce''': g5354sd343[[BR]]
 '''changes[alt]''':sample alt text

 And this is the notice I get when a custom media field attempts to update
 on blur:

 PHP Notice: Undefined index: nonce in [...]/wp-includes/pluggable.php on
 line 832

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


More information about the wp-trac mailing list