Forum Replies Created

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

    (@drebabels)

    I see where you are coming from, and if I understand you correctly what you are doing is allowing people to specify the retrieval of all attachments with a specific tag that is also attached to a specific post_type (i.e. ‘post’ or ‘page’ or ‘custom post type’). But I wonder if people have actually needed that sort of specificity?

    In my experience this has not been necessary. What I am more interested in is retrieving all ‘media’ content that has been tagged a certain way, regardless of what post_type it has been attached to.

    Now I realize that you said that this was not how this plugin was intended to be used, but using media-tags taxonomy on other post types seems to me to be well within how WordPress treats taxonomies. The built in taxonomy ‘tags’ is used on both ‘page’ and ‘post’ post types. And in my experience it has worked flawlessly so far (except for the issue that I am writing to you about now). So in my opinion it would be a mistake to limit the plugin to only being able to retrieve attachments.

    Perhaps then the answer is not to change the get_attachments_by_media_tags because it does do exactly what it was designed to do but rather to add a new function ‘get_posts_by_media_tags’ that would not assume that the content I am retrieving is an attachment.

    Thoughts?

    I was having this same problem. Unfortunately for me the problem was not with the sizes of my images. I was getting the error on every image… regardless of the size.

    In any case my problem was that the the Regen. Thumb plugin uses get_attached_file() to retrieve the filepath. The problem with this is that get_attached_file looks for a post metakey called _wp_attached_file which did not exist. (Not sure why this is the case… perhaps it was because all the content was imported from a non-wordpress blog). So to get the correct file path I did this:

    In the plugin regenerate-thumbnails.php file (line 352) I replaced

    $fullsizepath = get_attached_file( $image->ID );

    with

    $meta = wp_get_attachment_metadata($image->ID, true);
    $file = $meta['file'];
    $uploads = wp_upload_dir();
    $fullsizepath = $uploads['basedir'] . "/$file";

    And now I can regenerate my images.

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