Skip to content

Commit

Permalink
Updated getEntityRecord doc by using selector instead of dispatch (#5…
Browse files Browse the repository at this point in the history
  • Loading branch information
paulopmt1 authored Jun 11, 2023
1 parent 493d95a commit 5a1d376
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/explanations/architecture/entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The editor keeps track of all these modifications and orchestrates the saving of
To be able to edit an entity, you need to first fetch it and load it into the `core-data` store. For example, the following code loads the post with ID 1 into the store. (The entity is the post, the post 1 is the entity record).

````js
wp.data.dispatch( 'core' ).getEntityRecord( 'postType', 'post', 1 );
wp.data.select( 'core' ).getEntityRecord( 'postType', 'post', 1 );
````

Once the entity is loaded, you can edit it. For example, the following code sets the title of the post to "Hello World". For each fetched entity record, the `core-data` store keeps track of:
Expand Down

0 comments on commit 5a1d376

Please sign in to comment.