Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widget Visibility: WP_User_Query deprecation notice #22558

Closed
cr0ybot opened this issue Jan 30, 2022 · 0 comments · Fixed by #22559
Closed

Widget Visibility: WP_User_Query deprecation notice #22558

cr0ybot opened this issue Jan 30, 2022 · 0 comments · Fixed by #22559
Assignees
Labels
[Feature] Widget Visibility [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended

Comments

@cr0ybot
Copy link

cr0ybot commented Jan 30, 2022

Just wanted to report this deprecation notice I'm getting on the Widget edit screen with Jetpack version 10.5.1 on WP 5.9:

[30-Jan-2022 16:36:26 UTC] PHP Deprecated:  WP_User_Query was called with an argument that is <strong>deprecated</strong> since version 5.9.0! <code>who</code> is deprecated. Use <code>capability</code> instead. in ***/wp-includes/functions.php on line 5600
[30-Jan-2022 16:36:26 UTC] PHP Stack trace:
[30-Jan-2022 16:36:26 UTC] PHP   1. {main}() ***/wp-admin/widgets.php:0
[30-Jan-2022 16:36:26 UTC] PHP   2. require() ***/wp-admin/widgets.php:32
[30-Jan-2022 16:36:26 UTC] PHP   3. do_action() ***/wp-admin/widgets-form-blocks.php:67
[30-Jan-2022 16:36:26 UTC] PHP   4. WP_Hook->do_action() ***/wp-includes/plugin.php:474
[30-Jan-2022 16:36:26 UTC] PHP   5. WP_Hook->apply_filters() ***/wp-includes/class-wp-hook.php:331
[30-Jan-2022 16:36:26 UTC] PHP   6. Jetpack_Widget_Conditions::widget_admin_setup() ***/wp-includes/class-wp-hook.php:307
[30-Jan-2022 16:36:26 UTC] PHP   7. get_users() ***/wp-content/plugins/jetpack/modules/widget-visibility/widget-conditions.php:223
[30-Jan-2022 16:36:26 UTC] PHP   8. WP_User_Query->__construct() ***/wp-includes/user.php:763
[30-Jan-2022 16:36:26 UTC] PHP   9. WP_User_Query->prepare_query() ***/wp-includes/class-wp-user-query.php:77
[30-Jan-2022 16:36:26 UTC] PHP  10. _deprecated_argument() ***/wp-includes/class-wp-user-query.php:372
[30-Jan-2022 16:36:26 UTC] PHP  11. trigger_error() ***/wp-includes/functions.php:5600
jeherve added a commit that referenced this issue Jan 31, 2022
Fixes #22558

In https://core.trac.wordpress.org/ticket/16841 , WP_User_Query was updated to accept a new parameter, capability, to look for specific users. In turn, the "who" parameter (in use in Jetpack) was deprecated. Let's support both parameters for now.
@jeherve jeherve added [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended labels Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Widget Visibility [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants