WordPress.org

Ready to get started?Download WordPress

Forums

Media Tags
tags_compare AND bug (3 posts)

  1. 3r1c
    Member
    Posted 1 year ago #

    I have three Media-Tags, tag1, tag2 and tag3.

    I'm using tags_compare to grab all images tagged with $tag and tag3.

    get_attachments_by_media_tags('media_tags="'.$tag.',tag3"&tags_compare=AND');

    If $tag equals tag4, a non-existent Media-Tag, the results return every image tagged with tag3. I was expecting it to return zero results.

    Just something I noticed. Thanks for the great plugin!

    (Version 3.0.5)

    http://wordpress.org/extend/plugins/media-tags/

  2. pmenard
    Member
    Plugin Author

    Posted 1 year ago #

    3r1c, Thanks for the bug report. I'll be working on updating Media-Tags to support some changes coming in WordPress 3.5. So will look into this issue. Thanks.

  3. Jeff
    Member
    Posted 1 year ago #

    @3rc1 - might the probably be that your slugs don't match your tags? I was having a similar problem to what you described. I noticed a comment in the code that indicates AND comparisons need to search via slugs and not names. In my case, the slugs and names did not match up so the query was not returning the results I expected.

    The comment in the plugin reads:

    Force 'OR' on compare if searching by name (not slug). This is because the name search will return multiple values per each 'media_tags' searched item.

    Once I had the proper slugs going into the parameters instead of the names, the AND comparison was working successfully.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic