WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#22769 closed defect (bug) (fixed)

Hidden fields via attachment_fields_to_edit are missing

Reported by: nacin Owned by: koopersmith
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: has-patch commit
Focuses: Cc:

Description

They were kept separate to be rendered separately, but they never made it there. They should be placed into the chunk of HTML as before.

Attachments (1)

22769.diff (987 bytes) - added by nacin 8 years ago.

Download all attachments as: .zip

Change History (8)

@nacin
8 years ago

#1 @nacin
8 years ago

  • Keywords has-patch commit added
  • Version set to trunk

Tested. Properly prints it on post.php. The dialog properly sends it back to the save-attachment-compat handler.

#2 @nacin
8 years ago

Test code:

add_filter( 'attachment_fields_to_edit', function( $fields ) {
    $fields['hidden_field_name'] = array( 'input' => 'hidden', 'value' => 'value of field' );
    return $fields;
} );

#3 @koopersmith
8 years ago

Success. +1.

#4 @koopersmith
8 years ago

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

In 23086:

Add hidden fields via attachment_fields_to_edit to the existing compat output. props nacin. fixes #22769.

#5 @kylegilman
8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Thanks for fixing this so quickly and I'm sorry I wasn't able to check it sooner, but the hidden fields don't have IDs anymore, they only have names. Previous versions had matching IDs and names.

#6 @nacin
8 years ago

The IDs weren't exactly valid, since they had brackets in them accidentally.

I don't see this as an issue. A hidden field is good for its name and value, not its ID. If you were doing crazy manipulation on the fly via JS, that JS would no longer be loaded in the two instances of attachment_fields_to_edit, anyway — the new modal and post.php for attachments, versus the old media-upload.php script.

#7 @nacin
8 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.