• Resolved Lee Kung

    (@grmark)


    it seem the plugin work with new upload pdf only,
    Here is issues on editing post.
    1. click on feature image. the popup media show 2 thumbnails. the image and pdf. it should show only one
    2. after delete old feature image and assign another existing pdf. the wp_posts table not getting update, front end still get the old pdf. I think there should be “edit_attachment” or “edit_post” hook update attachment record.

    anyway, thanks for good plugin.

    https://wordpress.org/plugins/pdf-image-generator/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Lee Kung

    (@grmark)

    sorry, the second point is already correct
    here is what I do to get correct pdf_id

    //in post loop
    $image_id = get_post_meta( $post->ID, '_thumbnail_id', true );
    if($image_id) {
        $image = get_post($image_id);
        if($image && $image->post_parent > 0) {
            $pdf = get_post($image->post_parent);
            if($pdf && $pdf->post_mime_type == 'application/pdf') {
                $pdf_url = wp_get_attachment_url($pdf->ID);
            }
        }
    }
    Plugin Author Mizuho Ogino

    (@fishpie)

    Hi.

    This error was caused by the option setting of Featured Image. At first, I designed the plugin to allow PDF itself as Featured image. The option hasn’t functioned well since v1.3.6 or older….
    Anyway, I updated and clean the options up.

    On this occasion, I modified behavior of thumbnail on List mode of Media Library, which you report on the other thread.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘attachment not update on edit post, replace pdf’ is closed to new replies.