-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Problem
Currently (or when #71630 is merged), we have three block binding sources that create redundancy:
core/entity- Handles both post-type and taxonomy entities using block attributescore/post-data- Handles post entities using block contextcore/term-data- Handles taxonomy entities using block context
The core/entity source duplicates functionality that could be provided by the existing Post and Term data sources, creating unnecessary maintenance overhead and code complexity.
Part of #67520
Goal
Eliminate the core/entity block binding source by enhancing the existing core/post-data and core/term-data sources to support attribute-based data retrieval, making them more flexible and removing the need for a separate entity source.
Solution Outline
- Enhance Post Data source to support attribute-based data retrieval and add
linkkey support for post-type entities - Enhance Term Data source to support attribute-based data retrieval (already has
linkkey for taxonomy entities) - Update Navigation Link hook to programmatically choose between Post/Term bindings based on the
kindattribute (post-type→core/post-data,taxonomy→core/term-data) - Remove Entity source entirely once the enhanced sources are in place
This approach maintains backward compatibility while eliminating redundancy and centralizing entity handling logic in the appropriate domain-specific sources.
Related Work
This issue tracks the requirement to normalize the block binding sources as discussed in PR #71630. The PR implements the initial core/entity binding source, but this issue addresses the follow-up work needed to eliminate redundancy by enhancing the existing Post and Term data sources instead.