Repository navigation
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
getAuthorsin favor ofgetUsersand removes__unstableGetAuthorselector.How has this been tested?
Running following code should display deprecation message in console:
Screenshots
Types of changes
Deprecation
Checklist:
*.native.jsfiles for terms that need renaming or removal).