https://github.com/bacoords/example-query-loop-button
Add Custom Fields to Buttons in the Query Loop
https://github.com/bacoords/example-query-loop-button
Last synced: about 1 year ago
JSON representation
Add Custom Fields to Buttons in the Query Loop
- Host: GitHub
- URL: https://github.com/bacoords/example-query-loop-button
- Owner: bacoords
- Created: 2023-11-29T05:05:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-05T17:40:13.000Z (over 2 years ago)
- Last Synced: 2025-05-12T11:05:37.962Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://www.briancoords.com/adding-custom-fields-attributes-to-core-blocks/
- Size: 171 KB
- Stars: 13
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Example Query Loop Button Extension
Extends the button block to allow you to populate the `href` value automatically with the permalink or to a custom meta field. This is especially useful in the query loop, where you may want a custom button for your read more link.
[🎥 The full tutorial](https://www.briancoords.com/adding-custom-fields-attributes-to-core-blocks/).

This repo is part of a tutorial that teaches you how to:
1. Add custom attributes (aka custom fields) to a core block, and
2. Modify the final frontend markup of the block based on the attribute values