Support » Plugin: Author Avatars List/Block » Consider products as blog posts

  • Resolved yannickburky

    (@yannickburky)


    Your plugin is not only awesome, but it’s also the only one, congratulations for that. But I have a little problem.

    My authors don’t make blog posts but publish products (woocommerce).

    Therefore, min_post_count=1 does not display any products.
    But that’s exactly what I’d like to do: display only the authors of published products.

    Can you help me?

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

    (@pbearne)

    Hi @yannickburky

    I got to look at the code

    there is a filter aa_get_user_postcount that you can use to change what the count value is

    return apply_filters( 'aa_get_user_postcount', $total, $user_id )

    Untested example code

    add_filter( 'aa_get_user_postcount', 'aa_get_user_postcount', 10, 2 );
    
    function aa_get_user_postcount( $total = 0, $userid ){
    
       return count_user_posts( $userid, 'product', true ) ;
    }

    hope this helps

    PAul

    • This reply was modified 6 months, 2 weeks ago by Paul Bearne.

    Yes it works perfectly !! Thanks Paul ❤

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.