Created
August 19, 2024 17:37
-
-
Save andrewlimaza/17c64bedbda78c7f8abf47c8c805f0dc to your computer and use it in GitHub Desktop.
When Last Login - User Statistics (Custom Role Filter)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Tweak the user capability required to view the When Last Login - User Statistics charts/reporting. | |
* This requires V1.1+ of When Last Login - User Statistics. | |
* Add this code to your site by following this guide - https://yoohooplugins.com/customize-wordpress/ | |
*/ | |
function my_wll_user_stats_admin_cap( $capability ) { | |
return 'edit_users'; // Change this to the custom capability value. | |
} | |
add_filter( 'wll_stats_access_cap', 'my_wll_user_stats_admin_cap', 10, 1 ); | |
add_filter( 'wll_rest_api_caps', 'my_wll_user_stats_admin_cap', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment