Skip to content
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

An overview of the "Block hooks" #168

Closed
bph opened this issue Sep 7, 2023 Discussed in #162 · 7 comments
Closed

An overview of the "Block hooks" #168

bph opened this issue Sep 7, 2023 Discussed in #162 · 7 comments

Comments

@bph
Copy link
Collaborator

bph commented Sep 7, 2023

Discussed in #162

Originally posted by ndiego September 1, 2023
The feature for "Auto-inserting blocks" is coming in WordPress 6.4. The name might still be TBD, but the approach for this article will be an overview of the feature with 2-3 examples of how it can be used.

This feature has major implications for extenders and the article, coupled with technical documentation, will help educate the community. Ideally, this should be published right after Beta 1 (9/26)

Edit: This feature is now called Block hooks.

@ndiego
Copy link
Member

ndiego commented Oct 11, 2023

This post is going to be put on hold until the 6.5 release cycle. The current implementation of Block Hooks has a number of limitations that will be addressed following the release of 6.4. Therefore, it makes the most sense to wait until the feature receives additional development to spotlight on the Developer Blog.

@bph bph changed the title An overview of the "Block hooks" feature coming in 6.4 An overview of the "Block hooks" Dec 16, 2023
@ndiego
Copy link
Member

ndiego commented Mar 22, 2024

The drafted article is available here: https://docs.google.com/document/d/1U-sUW0YM1tq1YblHf5zAGWcR5k35ujO3t81y_wWzZo8/edit

@ockham has already provided a technical review. 🙏

@justintadlock
Copy link

Great work with this, Nick! First review is complete.

@ndiego
Copy link
Member

ndiego commented Mar 24, 2024

Given the length and breadth of this article, I changed the title to "Exploring the Block Hooks API in WordPress 6.5". Let me know what you all think. It is the same title as the Developer Hours session, but the session will be covering the examples in the article, so I kinda like the symmetry.

@bph
Copy link
Collaborator Author

bph commented Mar 25, 2024

I am looking at it in the Public Post Preview.

  • I would remove the Example: 1 & Example 2 etc. from the subheaders or put them into parenthesis at the end of the subheader. It's not the most important part of what you are describing. (and better for SEO)
  • Examples 3 second sentence - "the Block Hooks API only worked with dynamic blocks, not statically rendered ones." wouldn't it be the other way around? Save = null is for dynamic blocks.. And that wasn't possible. - It also feels that the distinction doesn't matter in the example?

I also share for your convenience the two check lists.

Pre-publishing checklist: (updated 1/29/2024)

  • Post Title and subheaders in sentence case
  • Are Category or Categories selected?
  • Are Tags identifies?
  • Is there an explicit Excerpt?
  • Are all images files uploaded to the media library
  • Do all images have an alt-text?
  • For TOC us the Pattern under Developer Blog > Table of contents
  • Assign or upload a featured image
  • Props added? (See Guidelines)
  • add copy for a social post as comment to this issue (example)
    🙌 Publish! 📗

Post-publishing checklist

  • add Props for reviews to #props channel in WP Slack (Example) (use Slack handles)
  • close the issue with a comment to link to the published post
  • close the accompanying discussion with the link to the published post.

@ndiego
Copy link
Member

ndiego commented Mar 25, 2024

I would remove the Example: 1 & Example 2 etc. from the subheaders or put them into parenthesis at the end of the subheader. It's not the most important part of what you are describing. (and better for SEO)

All fixed!

Examples 3 second sentence - "the Block Hooks API only worked with dynamic blocks, not statically rendered ones." wouldn't it be the other way around? Save = null is for dynamic blocks.. And that wasn't possible. - It also feels that the distinction doesn't matter in the example?

Ahh good catch. "not hook blocks" was supposed to say "only hook blocks". All fixed.

The distinction here is really for folks who tried out the API in 6.4 and ran into the dynamic block limitation. You couldn't hook a Paragraph block with content until 6.5.

Thanks for reviewing 🙏

@ndiego
Copy link
Member

ndiego commented Mar 25, 2024

The article has been published! 🎉

Social copy

The Block Hooks API is an extensibility mechanism that allows you to dynamically insert blocks into block themes. Learn how to use the API in your own projects in this comprehensive overview on the Developer Blog.

https://developer.wordpress.org/news/2024/03/25/exploring-the-block-hooks-api-in-wordpress-6-5/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Published (Done)
Development

No branches or pull requests

4 participants