Replies: 1 comment 3 replies
-
This is a little above my paygrade, but I'll just mention that I write to and from custom tables all the time in some blocks I've written, and I just treat them as variables in an array (that is, as returned from a DB query). The block editor has no idea of my shenanigans and there's no second entity... Is that a direction to explore, or is the entity part of this needed? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to have additional functionality of my custom block to save some metadata (email) to custom table. The reason is to obfuscate this from post content and make it available to backend when frontend requests sending mail via id key.
I attempted this: I created custom table, created entity and used useEntityRecord to read and save data from table, created custom REST endpoints. So far so good, everything works.
But, when email address is edited in the block, editor shows second save option (like when saving from site editor and you change both template and page) - because email is separate entity:
Ideally, email would be saved to separate table when saving post, but in the editor there would be no question about saving two separate things (block also has attributes that can be changed), saving should function like normal blocks do.
Beta Was this translation helpful? Give feedback.
All reactions