Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Display settings 'label' defined by the 'register_setting' method #59243
Display settings 'label' defined by the 'register_setting' method #59243
Changes from all commits
f875c12
cffa889
bf0b9ff
30ba923
579dce7
96ee0ea
0c1a177
3f2d0f1
3ad2c56
f95e7af
fb77e6b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this function need a "name" now. I believe the purpose of this function is to load the entities of a given "kind", so "name" is not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
root
is a standardkind
, and execution never reaches additional loaders. I'm using thename
to narrow things down.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I admin that I'm not following. There's something I'm obviously missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rootEntitiesConfig
has akind
root (as the const name suggests).select.getEntitiesConfig( kind )
will always return the list of configs forkind === root
getOrLoadEntitiesConfig
never reaches the addition entity config loading logic to load thesite
entity.gutenberg/packages/core-data/src/entities.js
Lines 459 to 468 in ec86a82
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we instead update the condition to check whether a key exist in
additionalEntityConfigLoaders
and maybe have some "meta" state to indicate that we're loading or we've already loaded (maybe we can even reuse the metadata state that exist in all stores)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been thinking more, basically what we want is a resolver for.
getEntityConfig( kind, name )
. In other words, I'm ok with passing the name but we should change the description of the function.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'm happy to give it a try. However, we might encounter a similar issue without using the entity
name
whenadditionalEntityConfigLoaders
contains more than one entity of the samekind
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep your changes but just clarify things in the description. I'm not entirely satisfied with how we're dealing with all of that, but it's not clear to me what's the best path forward is yet:
It seems there's potentially a better way/API to "register" these entities.