get_users “who” argument is deprecated since WP version 5.9.0
-
I see a lot of errors in my log with
PHP Deprecated: Function WP_User_Query was called with an argument that is deprecated since version 5.9.0! who is deprecated. Use capability instead. in /wp-includes/functions.php on line 6031
Apparently argument
who
inget_users
is deprecated since WP version 5.9.0 and there a lot of places where I see it inclass-anwp-post-grid-elements.php
Suggestion is to use
capabilities
for newer versions of WP using something likeif ( version_compare( $GLOBALS['wp_version'], '5.9', '<' ) ) { $args['who'] = 'authors'; } else { $args['capability'] = [ 'edit_posts' ]; }
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘get_users “who” argument is deprecated since WP version 5.9.0’ is closed to new replies.