-
Notifications
You must be signed in to change notification settings - Fork 8
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
Insert Block command #59
Conversation
@dinhtungdu before this PR goes to review I have question: This PR adds "Insert Block" command and is tested against different built-in block types, including sub-blocks ( Do you think it worth to be done or we could keep core-only blocks in our test? |
@cadic This is a blocker to me as well.
I think as long as we pass the correct block name, there is no difference between core and custom blocks. So my answer to your question is no, I don't think it's worth adding a custom block to our example plugin. On the other hand, we can test inserting custom blocks without creating our own. I think any simple block plugin in the block directory can be used for our testing. |
@dinhtungdu thank you for the idea of using external plugin for custom blocks. Added https://github.com/10up/retro-winamp-block/ and it works like a charm! |
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.
@dinhtungdu thank you so much for checking the tests on your side. The command itself is fine, but the test has a typo in its conditional part which caused skipping the test when it should be executed. |
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.
LGTM 🚢
Insert Block command
Description of the Change
Adds
insertBlock
command. Yields the block element ID:Tests include custom block from 10up/retro-winamp-block, it doesn't support WordPress 5.2, so this test is optional.
Checklist:
Changelog Entry
Added -
insertBlock
commandCredits
Props @cadic