Adding Custom Fields (Attributes) to Core Blocks


Using just three filters, we’ll add a few custom fields to the core “Button” block in WordPress that will update the button’s content on the front end. We’ll use a little bit of JavaScript, including WordPress/scripts and WordPress/components, as well as the new WP_HTML_Tag_Processor class in PHP.

👉 Code:
👉 Block Filters:
👉 SlotFill:
👉 Gutenberg Storybook:–page

Receive my new posts and videos in your inbox, along with some links and thoughts from the web dev world. No more than once a month. Browse the archive.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.