WordPress.org

Support

Support » Plugins and Hacks » Multiple Post Thumbnails » [Resolved] [Plugin: Multiple Post Thumbnails] BUG when user deletes image from media library

[Resolved] [Plugin: Multiple Post Thumbnails] BUG when user deletes image from media library

  • 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/

Viewing 5 replies - 1 through 5 (of 5 total)
  • is there a way to solve this?,..

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

    Plugin Author Chris Scott

    @chrisscott

    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.

    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.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] [Plugin: Multiple Post Thumbnails] BUG when user deletes image from media library’ is closed to new replies.
Skip to toolbar