Media Tags
tags_compare AND bug (3 posts)

  1. 3r1c
    Posted 3 years ago #

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

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


    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)


  2. Paul Menard
    Plugin Author

    Posted 3 years 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
    Posted 2 years 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

  • Media Tags
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic