WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Post Thumbnails
[resolved] BUG when user deletes image from media library (6 posts)

  1. c.note
    Member
    Posted 2 years ago #

    When a users deletes the an image from the user library without removing it as the secondary post thumb, a new image cannot be added. It just stays blank but the meta value in the wp_postmeta table has the old image reference in it. This is quite a critical bug as the only way to rectify it is to remove the record in wp_postmeta table.

    http://wordpress.org/extend/plugins/multiple-post-thumbnails/

  2. David Chandra Purnama
    Member
    Posted 2 years ago #

    is there a way to solve this?,..

  3. lonchbox
    Member
    Posted 2 years ago #

    Hi there, Any news if this going to be solved ?

  4. Chris Scott
    Member
    Plugin Author

    Posted 2 years ago #

    Please try this version of the plugin: http://plugins.svn.wordpress.org/multiple-post-thumbnails/trunk/multi-post-thumbnails.php

    WARNING: Be sure to back up your database first and/or use this on a test installation. I've tested this with a few different configurations, however, since it does a delete on database rows, better safe than sorry.

  5. Gabriel
    Member
    Posted 2 years ago #

    Hi, to solved this without going to the database I do this modification on the functiĆ³n set_thumbnail:

    if (!empty($thumbnail_html)) {
                                            delete_post_meta($post_ID, "{$this->post_type}_{$this->id}_thumbnail_id");
                                            update_post_meta($post_ID, "{$this->post_type}_{$this->id}_thumbnail_id", $thumbnail_id);
                                            die($this->post_thumbnail_html($thumbnail_id));
                                    }

    Apply the "delete_post_meta" before "update_post_meta". This fix the problem when you remove and image from the media and not in the post.

  6. c.note
    Member
    Posted 2 years ago #

    The script has been updated by the author, Chris Scott.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic