Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Vincent Mimoun-Prat

    (@vprat)

    Yes, it is a known limitation and so far I have not found a satisfying solution (which does not imply losts of heavy database queries each time)

    Thread Starter VisiCom

    (@yapaslfeu)

    If the “hide_empty” checkbox is set, you should add an “include” parameter while calling the get_terms function.
    The list of ID to include can be found with a single SQL query retrieving distinct categories ID for all posts belonging to the current user.
    You’ll probably need to modify the “cache_domain” setting of the get_terms function in order to speed up the process…

    Another solution is to use the “terms_clauses” filter once an user is logged:
    add_filter(‘terms_clauses’, ‘term_filter’, ”, 1);
    function term_filter($pieces){
    $pieces[‘where’] .= ‘SQL to only include posts belonging to the current user’;
    return $pieces;
    }

    Plugin Contributor Vincent Mimoun-Prat

    (@vprat)

    As I am overbooked currently, I will not get the time to do that before October more or less. If you feel at ease with PHP, you could try to implement that directly in the plugin. Let me know if you need some help about how to find something in particular in the plugin code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Files categories widget not working as expected’ is closed to new replies.