Support

Account

Home Forums Backend Issues (wp-admin) Moving Fields Up in Attachment Details View?

Solving

Moving Fields Up in Attachment Details View?

  • When I added custom fields for attachments, they are added below everything else on the attachment detail view. Is there anyway I can move them higher up?

    Ideally after title or caption, but i was be find with just below description. See image below.

    null

  • No, at least not that I am aware of. ACF uses the hook attachment_fields_to_edit https://codex.wordpress.org/Plugin_API/Filter_Reference/attachment_fields_to_edit.

    it may be possible, but it would take quite a bit of testing just to figure if it is or not. I would start by adding a filter on that hook and somehow figure out to see what is in the value $form_field and then go from there.

    
    // this added to the filter will output the contents of $form_fields
    // to your error log so you can inspect it
    ob_start(); print_r($form_fields); error_log(ob_get_clean());
    

    but looking at the code in ACF, I’m guessing that it may not work. There are styles associated with the fields that ACF adds, and there may be JavaScript and the JS may be expecting to find the fields in a specific location. And of course, this all depends on whether or not WP includes the standard fields in the form fields it passes.

    Sorry I can’t be of more help.

  • Yeah that’s what I thought. I ended up just manually adding the fields with the attachment_fields_to_edit hook. Thanks for your help.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Moving Fields Up in Attachment Details View?’ is closed to new replies.