I am getting error while running a function get_users() in my custom plugin
PHP Fatal error: Uncaught Error: Call to undefined function cache_users() in /Users/priyankgohil/sites/upw-new/wp-includes/class-wp-user-query.php:843
Stack trace: #0 /Users/priyankgohil/sites/upw-new/wp-includes/class-wp-user-query.php(79): WP_User_Query->query() #1 /Users/priyankgohil/sites/upw-new/wp-includes/user.php(763): WP_User_Query->__construct(Array) #2 /Users/priyankgohil/sites/upw-new/wp-content/plugins/my-plugin/Inc/BaseController.php(214): get_users(Array)
is anyone have solution or facing same issue after upgrade to wordpress 6.1
To include the fix in your own plugin code, try this (worked for me)
I'd suggests that's better than hacking core files.