• Resolved manakuke

    (@manakuke)


    I swear I do more than fiddle with authenticating users in WordPress ??

    Not urgent, but would it be possible to add a count feature to see the number of users in each category? I’m mostly interested in the count of Approved Users on the sub-site level.

    I added the code below to the plugin and it gave me what I was looking for, but perhaps there is a more elegant way to accomplish this. The below example displays the count for approved users. Same can be implemented for Pending and Blocked as needed. Implementing with pending only displays if there is any pending since you already have an existing “if” statement. The same thing could be added for the blocked section so that the count only shows when there are any to count. Anyway, for my particular use case, seeing the number of Approved at a glance is helpful since I pre-imported a bunch of users before they tried accessing the website (ie the number of subscribers, admins, etc doesn’t match the number of approved).

    Before the “foreach” statement at line 2603, add the following code:
    $count_users = 0;

    After the “foreach” statement above, add the following code:
    $count_users++;

    After the “endforeach” statement at line 2670, add the following script:
    <script> jQuery( "#list_auth_settings_access_users_approved" ).before( "<p>Count of Approved Users: <?php echo $count_users; ?></p>" );</script>
    or using $option to future proof:
    <script> jQuery( "#list_auth_settings_<?php echo $option; ?>" ).before( "<p>Count of Blocked Users: <?php echo $count_users; ?></p>" );</script>

    https://www.ads-software.com/plugins/authorizer/

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Count of Users Feature Request’ is closed to new replies.