Open helgatheviking opened 7 months ago
I came across this yesterday when building out a custom block and I found it used in one or two blog tutorials (example) but couldn't find it in the documentation.
I believe the documentation is not automatically populating, possibly because there isn't a JS DocBlock associated with the source code in Core. Not sure how this data is pulled into the Plugins Handbook...
It looks like the useEntityProp
hook is used contextually access post_meta
from the @wordpress/core-data
datastore. It's a fairly advanced JavaScript hook that can be a bit confusing to implement.
This may be a good candidate for the block-development-examples
repo.
Or discussion can be had if adding comments in the documentation will auto-populate the info for the hook.
If you want to raise a question about an example for useEntityProp
in the block-development-examples
repo - that may be a good place for a simple example of what this hook does.
Or maybe it should be provided in the Plugins Handbook, unsure of the scope.
Here's a video that may go over the hook https://www.youtube.com/watch?v=MtVRifFbUaQ
Here's a repo that may cover it already... https://github.com/ryanwelcher/twitch/tree/65d1f9f5b7ea65b4388ea02a16c974752ad1872e/plugins/display-meta
Finished prototype from the video above https://blockdevelopercookbook.com/recipes/post-meta-testimonial-block/
I came across this yesterday when building out a custom block and I found it used in one or two blog tutorials (example) but couldn't find it in the documentation.