Загрузка...

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

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-editor/reference-guides/packages/packages-core-data/#addentities
rest_api_init hook: https://developer.wordpress.org/reference/hooks/rest_api_init/
register_rest_route function: https://developer.wordpress.org/reference/functions/register_rest_route/
invalidateResolution: https://github.com/WordPress/gutenberg/blob/trunk/packages/data/src/redux-store/metadata/actions.js#L118
Transient API: https://developer.wordpress.org/apis/transients/
How webpack and WordPress packages interact: https://kdta.io/yhpMc

#wordpress #gutenberg #wordpresstutorial #wordpressplugin #gutenbergtutorial

Видео Bring Me Your Issues #7! Live stream from May 4, 2023 канала Ryan Welcher Codes
Страницу в закладки Мои закладки
Все заметки Новая заметка Страницу в заметки

На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.

Об использовании CookiesПринять