Forums Forums Search & Filter Pro Filtering on custom taxonomy for attachment post-type

Viewing 7 posts - 1 through 7 (of 7 total)
  • Trevor
    #235658
    This reply has been marked as private.
    Anonymous
    #235664
    This reply has been marked as private.
    Trevor
    #235685
    This reply has been marked as private.
    Anonymous
    #235688

    I figured out that the main problem is that WordPress doesn’t seem to update term-relationships for terms in the post type ‘attachment’. I think that’s the main problem and that’s not really related to Search and Filter.

    I wrote an SQL statement to update the count, and added it to the hooks ‘add_attachment’ and ‘edit_attachment’:
    “UPDATE wp_term_taxonomy SET count = (
    SELECT COUNT(*) FROM wp_term_relationships rel
    LEFT JOIN wp_posts po ON (po.ID = rel.object_id)
    WHERE
    rel.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
    )”

    This works, the count on the taxonomy page seems correct now. However, I added some extra filters in the ‘Post Meta’ tab of Search & Filter. The filter counters in Search & Filter don’t seem to take those into account. Do you notice this as well?

    Trevor
    #235723
    This reply has been marked as private.
    Anonymous
    #235727
    This reply has been marked as private.
    Ross Moderator
    #236305
    This reply has been marked as private.
Viewing 7 posts - 1 through 7 (of 7 total)