Support » Plugin: Author Avatars List » Any chance to add custom post types support?

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


    I need to think about this

    The way the plugin works is that get all users and then filter to remove hidden users etc.

    I could add to the filter to check if the use is part of custom post type

    Here is some that I might be able to start from

    But I would what to extend to to support multiple custom page types

    And if this is set is this an only or add option

    so we might need to have 2 options

    just_post_types=”dddd,page” and add_post_types=”dddd”

    This will need to be added to the options as well as the shortcode handler

    I will see if I can poke at the code and let you know how I get on

    Ping me if I haven’t got to in a couple weeks


    I’ve just found a working solution that fits my needs by hardcoding the plugin.

    At /author-avatar/lib/UserList.class.php:944, $total variable gets new values as following:

    global $wpdb;
    $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = $user_id AND post_type IN ('my_cpt') and post_status = 'publish'" );
    $regposts += count_user_posts($user_id);
    $total = $regposts + $count;

    Here ‘my_cpt’ is the custom post type I’m interested in.

    I guess the plugin should have at options a list of public and queryable post types to select from, that would be included in the sum.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Any chance to add custom post types support?’ is closed to new replies.