-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: GiveWP BlockTypes #7195
Conversation
@kjohnson i've been gradually working on this during my Fridays. would love to get your thoughts on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea. It would certainly help to make the conversion process more easily testable and could be beneficial to mirror the typing on the server side.
This PR is stale because it has been open 45 days with no activity. Stale PRs will NOT be automatically closed. |
@kjohnson anymore thoughts on this? If not, I would like to merge and start using it 🧙 |
No objections here. I gave it another look over and it looks good to me. Having tests here is a big help! |
Description
Introducing GiveWP BlockTypes!
The idea for GiveWP BlockTypes is to take generic block models and convert them into identifiable first-class BlockType models that have type-enabled properties and built-in casting.
Instead of this:
We would have this:
Thoughts:
$properties
array actually gets generated by the block.json file one day 🤯label
,fieldName
,conditionalLogic
, etc using traits.$blockType->toField()
would make the block to field conversion cleaner and more testable.Affects
Currently this is not being used anywhere.
Visuals
N/A
Testing Instructions
This would need to be done programatically
Pre-review Checklist
@unreleased
tags included in DocBlocks