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

Core Data: Clarify comments for entities' plural methods #59946

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/core-data/src/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export const rootEntitiesConfig = [
'url',
].join( ',' ),
},
// The entity doesn't support selecting multiple records.
// The property is maintained for backward compatibility.
plural: '__unstableBases',
syncConfig: {
fetch: async () => {
Expand All @@ -64,6 +66,8 @@ export const rootEntitiesConfig = [
name: 'site',
kind: 'root',
baseURL: '/wp/v2/settings',
// The entity doesn't support selecting multiple records.
// The property is maintained for backward compatibility.
plural: 'sites',
getTitle: ( record ) => {
return record?.title ?? __( 'Site Title' );
Expand Down Expand Up @@ -406,7 +410,7 @@ async function loadTaxonomyEntities() {
}

/**
* Returns the entity's getter method name given its kind and name.
* Returns the entity's getter method name given its kind and name or plural name.
*
* @example
* ```js
Expand All @@ -418,7 +422,7 @@ async function loadTaxonomyEntities() {
* ```
*
* @param {string} kind Entity kind.
* @param {string} name Entity name.
* @param {string} name Entity name or plural name.
* @param {string} prefix Function prefix.
*
* @return {string} Method name
Expand Down