• Hey,

    when plugin is active attachments are not being attached when uploading images with ‘Add Media’ button above content editor on edit post page.

    This applicable for custom post types only.

    While debugging I’ve found that ‘post_id’ field is not passed to async-upload.php. But it is needed to determine ‘parent’ when creating attachment. When I deactivate plugin then it starts passing ‘post_id’ and works well.

    Help please. Thanks.

    https://wordpress.org/plugins/meta-box/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Anton Korotkoff

    (@anton-korotkoff)

    Well, this only happens if I add ‘image_advanced’ field for this post_type.

    Thread Starter Anton Korotkoff

    (@anton-korotkoff)

    Finally, I’ve found what is the cause.

    inc/fields/image-advanced.php line 20

    If I comment this line:

    wp_enqueue_media();

    standard attachments function works well.

    Any sort of fix or is it feature? Thanks.

    Plugin Author Anh Tran

    (@rilwis)

    Hi, thanks for your feedback. I’m trying to replicate your problem but I can’t. I use the plugin to add image_advanced field to WooCommerce product and the Add Media button works file for me?

    Thread Starter Anton Korotkoff

    (@anton-korotkoff)

    You are right add media button works but all the uploaded images are not attached to the post

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can't attach image to a custom post type’ is closed to new replies.