Bring Me Your Issues #7! Live stream from May 4, 2023

Опубликовано: 03 Март 2026
на канале: Ryan Welcher Codes
111
2

In this video, originally streamed on May 4, 2023, we look at how we can register our own entities in a data store for use with hooks like useEntityRecords and functions like getEntityRecords and how to invalidate the data that is returned to get a fresh query. Along the way, we discuss the intricacies of caching in WordPress.

0:00 Welcome
04:27 Registering custom entities with addEntities
06:20 Registering a custom endpoint for use with our custom entity
16:15 Registering our custom entity for use in the Featured Image block.
20:49 Benefits of registering a custom entity over using apiFetch
23:41 Making a new request using invalidateResolution
28:17 Explaining why we need to invalidate to get new data from the store
51:52 The two ways to cache in WordPress and the differences between them
58:48 Nuances of using invalidateResolution with the useEntityRecords hook


Resources:

Twitch Repo: https://kdta.io/Xe9sq
Twitch Channel:
addEntities: https://developer.wordpress.org/block...
rest_api_init hook: https://developer.wordpress.org/refer...
register_rest_route function: https://developer.wordpress.org/refer...
invalidateResolution: https://github.com/WordPress/gutenber...
Transient API: https://developer.wordpress.org/apis/...
How webpack and WordPress packages interact: https://kdta.io/yhpMc

#wordpress #gutenberg #wordpresstutorial #wordpressplugin #gutenbergtutorial