-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Core Data: Deprecate getAuthors
in favor of getUsers
#33725
Conversation
Size Change: +28 B (0%) Total Size: 1.08 MB
ℹ️ View Unchanged
|
@youknowriad @Mamaduka While I understand that it makes sense to deprecate this selector, there doesn't seem to be a way for plugins to conditionally use Example:
Thus, the only solutions for me are:
|
Hi @swissspidy Do you have any proposal on how such detection should work? |
My first hope was that I could just do something like
(1) is not reliable because it's difficult to find which version of WP/GB contains which change, especially because of backports. And plugins could load different versions of a package as well. (3) might not be too bad, but I worry that there will be support requests about this from users which think that this is a bug that needs updating. |
I'm not against removing deprecation as this is a very small thing but it feels like we should have an answer for this.
This doesn't sound very compelling: export things that are supposed to be internal just to check for support. |
Not suggesting that we should export that function. Definitely agree that it should be kept internal. It's just what I looked at & demonstrates how I imagined the feature detection could work. |
I guess we can add a settings flag in settings - const supportContext = !! select( blockEditorStore ).getSettings()?.__experimentalSupportContext;
// Do conditional fetching using supported selector... But this looks like solution one, only implemented on the Editor side. Happy to create a follow-up PR based on decisions made here. @swissspidy how do you handle fetching other entities for non-admin users? |
Due to limitations like #33420 we can't use |
Regarding the deprecation, I plan on committing https://core.trac.wordpress.org/ticket/16841 soon for 5.9, which will basically deprecate |
Can someone please help me get some documentation for the |
Available options are listed here: https://developer.wordpress.org/rest-api/reference/users/#list-users |
Description
Deprecates
getAuthors
in favor ofgetUsers
and removes__unstableGetAuthor
selector.How has this been tested?
Running following code should display deprecation message in console:
Screenshots
Types of changes
Deprecation
Checklist:
*.native.js
files for terms that need renaming or removal).