You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deprecation notice caused by EF's use of get_users():
PHP Deprecated: Function 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 5667
It's triggered by this code in /edit-flow/common/php/class-module.php:463:
That who argument is deprecated, I'm surprised it even worked this long! The error tells us it should instead use capability which makes total sense. The who=author section of the user query just converted it into a user_level != 0 query, which makes me feel dirty like I'm back in 2008.
So clearly we need to switch it for a proper cap test, to me it seems like edit_posts is a logical choice to replace "author", and is of course also logical because that's who will theoretically be able to interact with EF tools. Maybe not though? Maybe there's a reason to make it even more wide open, but in that case it seems like we can just remove this line entirely.
Anyway, here's the code I'm going to use in my local copy, pending someone doing something about this ticket:
From what I can tell, this works fine and addresses the issue.
Steps to Reproduce the Problem
Seems like it happens every time I open the post editor with the Notifications box present. For me the deprecation was hidden in the WP Debug bar menu, I only noticed it during acceptance testing.
(Optional) Additional notes
Thanks for the patch this last summer! It was great to see someone at least keeping this thing running, and it gave me another year without having to switch to PublishPress, so I appreciate it!
The text was updated successfully, but these errors were encountered:
jerclarke
changed the title
Fix deprecated
Fix deprecated 'who' argument for get_users/WP_User_Query
Feb 9, 2023
Expected/Desired Behavior
Clean error logs with WP_DEBUG enabled.
Actual Behavior
Deprecation notice caused by EF's use of
get_users()
:It's triggered by this code in
/edit-flow/common/php/class-module.php:463
:That
who
argument is deprecated, I'm surprised it even worked this long! The error tells us it should instead usecapability
which makes total sense. Thewho=author
section of the user query just converted it into auser_level != 0
query, which makes me feel dirty like I'm back in 2008.So clearly we need to switch it for a proper cap test, to me it seems like
edit_posts
is a logical choice to replace "author", and is of course also logical because that's who will theoretically be able to interact with EF tools. Maybe not though? Maybe there's a reason to make it even more wide open, but in that case it seems like we can just remove this line entirely.Anyway, here's the code I'm going to use in my local copy, pending someone doing something about this ticket:
From what I can tell, this works fine and addresses the issue.
Steps to Reproduce the Problem
Seems like it happens every time I open the post editor with the Notifications box present. For me the deprecation was hidden in the WP Debug bar menu, I only noticed it during acceptance testing.
(Optional) Additional notes
Thanks for the patch this last summer! It was great to see someone at least keeping this thing running, and it gave me another year without having to switch to PublishPress, so I appreciate it!
The text was updated successfully, but these errors were encountered: