Skip to content

Conversation

@cbravobernal
Copy link
Contributor

@cbravobernal cbravobernal commented Nov 24, 2025

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.

@cbravobernal cbravobernal self-assigned this Nov 24, 2025
@cbravobernal cbravobernal requested review from Copilot and priethor and removed request for Copilot November 24, 2025 15:33
@cbravobernal cbravobernal added the [Type] Enhancement New feature or request label Nov 24, 2025
@cbravobernal cbravobernal added this to the 6.7.0 milestone Nov 24, 2025
@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

❌ Patch coverage is 63.71681% with 82 lines in your changes missing coverage. Please review.
✅ Project coverage is 10.13%. Comparing base (65d8085) to head (42c0413).
⚠️ Report is 10 commits behind head on trunk.

Files with missing lines Patch % Lines
assets/src/js/bindings/field-processing.js 0.00% 38 Missing ⚠️
assets/src/js/bindings/utils.js 65.21% 16 Missing ⚠️
assets/src/js/bindings/hooks.js 86.15% 9 Missing ⚠️
assets/src/js/bindings/sources.js 57.14% 9 Missing ⚠️
...ncludes/rest-api/class-acf-rest-types-endpoint.php 76.00% 6 Missing ⚠️
assets/src/js/bindings/fieldMetadataCache.js 69.23% 4 Missing ⚠️

❌ 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     
Flag Coverage Δ
e2e 23.06% <62.18%> (?)
phpunit 6.66% <76.00%> (+2.96%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot finished reviewing on behalf of cbravobernal November 24, 2025 15:37
Copy link

Copilot AI left a 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.

@cbravobernal
Copy link
Contributor Author

Codecov seems not to be reading correctly the coverage. As assets/src/js/bindings/field-processing.jsis 100% covered and is saying it is at 0 😕

@cbravobernal cbravobernal marked this pull request as ready for review December 1, 2025 12:34
@github-actions
Copy link

github-actions bot commented Dec 1, 2025

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props cbravobernal.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@cbravobernal cbravobernal modified the milestones: 6.7.0, 6.7.1 Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants