Opened 5 months ago
Closed 5 months ago
#22769 closed defect (bug) (fixed)
Hidden fields via attachment_fields_to_edit are missing
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Media | Version: | 3.5 |
| Severity: | normal | Keywords: | has-patch commit |
| 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)
Change History (8)
Test code:
add_filter( 'attachment_fields_to_edit', function( $fields ) {
$fields['hidden_field_name'] = array( 'input' => 'hidden', 'value' => 'value of field' );
return $fields;
} );
comment:3
koopersmith — 5 months ago
Success. +1.
comment:4
koopersmith — 5 months ago
- Owner set to koopersmith
- Resolution set to fixed
- Status changed from new to closed
In 23086:
comment:5
kylegilman — 5 months 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.
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.

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