WordPress.org

Support

Support » Plugins and Hacks » Media Tags » [Plugin: Media Tags] tags_compare AND bug

[Plugin: Media Tags] tags_compare AND bug

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Paul Menard

    @pmenard

    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.

    Jeffrey Zinn

    @jeffreyzinn

    @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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Media Tags] tags_compare AND bug’ is closed to new replies.
Skip to toolbar