I used to use attachment_fields_to_edit filter, but it seems that in 3.5+ it has been dropped. What is the new way of adding additional attachment fields?


It seems that it wasn't dropped, but - deprecated. In 3.6 it operates in compatibility mode. To make a new field appear in media popup, one should set additional param - show_in_modal to true (helpful post here):

$form_fields['thumb-url'] = array(
    'label' => __('Thumbnail Url'),
    'input' => 'html',
    'html'  => <p> ... some html here ... </p>,
    'show_in_modal' => true // <- this one

But - still, the whole thing is deprecated and doomed to be dropped sooner or later. There should be a new way of doing things. Anyone knows what that'd be?

  • The filter is still there. What makes you think the opposite? – tfrommen Aug 17 '13 at 15:50

attachment_fields_to_edit is still there in 3.6. It is in /wp-admin/includes/media.php in a couple of places. Perhaps usage has changed, or something has changed that has broken your code but without that code it is impossible to tell.

  • 2
    It stopped working, but now I know that it requires additional params to show up. However as I see it operates in compatibility mode and is deprecated in general. Should I assume that there is no way to extend this updated part of WordPress anymore? – jayarjo Aug 18 '13 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.