Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter robbycornish

    (@robbycornish)

    can anyone help with this?

    Plugin Author Paul Wong-Gibbs

    (@djpaul)

    Hey

    Can you link me to the existing thread? It’ll save me figuring out the code again, and I’ll do my best to help you get it running on your site.

    It’ll also be interesting for me to know what type/kind of user you want to hide from your leaderboard. Is it something like a site admin you don’t want shown? Thanks.

    Thread Starter robbycornish

    (@robbycornish)

    Here is the existing thread:
    http://wordpress.org/support/topic/exclude-certain-users-types-from-achievements?replies=7

    I would like to exclude the site admin. But I also use a RSS Aggregator that creates a new user (if none exists) from the other blog. I guess I can make those Aggregator into Editors, so I would need to exclude Admin and Editors. But if I have the option to enter USER ID’s that would be better.

    Either way works for me!

    Thanks!

    Thread Starter robbycornish

    (@robbycornish)

    Is there an ETA on an update?

    Thanks Paul!

    Plugin Author Paul Wong-Gibbs

    (@djpaul)

    No. 🙂

    Developers can use the sample code linked to on that other thread to see where you can choose to ignore an event in a specific situation. It won’t remove users from the leaderboard, so you might need to go in and edit the admin user profiles and set their karma points score to zero.

    You’d probably want something like:

    <?php
    function pg_skip_admins( $register_events ) {
      if ( ! $register_events )
        return false;
    
      return current_user_can( 'activate_plugins' );
    }
    add_filter( 'dpa_maybe_register_events', 'pg_skip_admins' );

    I’m afraid editing the Karma points to zero still results in the user being in the Leaderboard with a point score of 0.
    Hope a future version will provide the ability to filter users like admins from the Leaderboard.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to exclude certain users from leaderboard?’ is closed to new replies.