• This problem has been reported to me several times already by people using my plugin Better Image Credits (https://wordpress.org/plugins/better-image-credits/) and I noticed it too on my own blog.

    This is something that appeared after version 4 was released. My plugin adds custom fields to the attachment so that an author can properly credit the author of an image. The problem is the following:

    When you are in the post editor and want to insert an image, the window that pops up include those extra fields, however, has soon as you enter data in them and change focus they immediately disappear and then are not saved.

    This does not happen when you edit an image from the media library, only when you insert into a post or page.

    Has anyone got a similar experience with other plugins?

Viewing 1 replies (of 1 total)
  • Thread Starter Claude Vedovini

    (@cvedovini)

    I found where the issue is coming from…

    I used to register attachment_fields_to_edit and attachment_fields_to_save hook during the admin_menu hook and until recently it was working without an issue

    At some point the core changed and now I have to register those hook during admin_init.

    Apparently, when the attachment edit form is contained in a frame admin_menu is not always called. Which kind of makes sense because there’s no menu except that it is still called at least once the first time the frame is loaded.

Viewing 1 replies (of 1 total)

The topic ‘Attachment fields magically disappear when adding image to post’ is closed to new replies.