-
Notifications
You must be signed in to change notification settings - Fork 45
Feature: Add binding connector to the site editor. #253
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
base: trunk
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (63.71%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## trunk #253 +/- ##
===========================================
+ Coverage 3.69% 10.13% +6.44%
- Complexity 4282 4289 +7
===========================================
Files 197 272 +75
Lines 26154 33302 +7148
===========================================
+ Hits 967 3376 +2409
- Misses 25187 29926 +4739
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull request overview
This PR adds a binding connector feature for the site editor, enabling users to connect block attributes (paragraphs, headings, images, buttons) to custom fields when creating custom templates for custom post types.
Key Changes:
- Refactored REST API endpoint for better maintainability and removed feature flag gate
- Added comprehensive JavaScript infrastructure for block bindings (store, hooks, utilities, field processing)
- Implemented site editor vs post editor context awareness with appropriate field handling
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
includes/rest-api/class-acf-rest-types-endpoint.php |
Refactored with constants, helper methods, improved validation, and added field name to REST response |
assets/src/js/bindings/utils.js |
New utility functions for field filtering, type checking, template parsing, and data formatting |
assets/src/js/bindings/store.js |
New Redux store for managing field metadata across block bindings |
assets/src/js/bindings/sources.js |
Refactored binding source with site editor support and field label placeholders |
assets/src/js/bindings/index.js |
Updated imports to include new store module |
assets/src/js/bindings/hooks.js |
Custom React hooks for site editor context, field fetching, and binding state management |
assets/src/js/bindings/field-processing.js |
Extracted field processing logic for better code organization and reusability |
assets/src/js/bindings/constants.js |
Configuration defining which field types bind to which block attributes |
assets/src/js/bindings/block-editor.js |
Refactored block controls using new hooks and utilities for cleaner code |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codecov seems not to be reading correctly the coverage. As |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What
Adds the ability to connect paragraphs and images to custom fields in the site editor. Enhancing the creation of custom templates for custom post types with custom fields.
Screenshare
SCF-edit.mp4
It needs
The field group must have REST API enabled.
Fields must have Block Bindings setting enabled.