Skip to content

Eliminate Entity Block Binding Source Redundancy #72059

@getdave

Description

@getdave

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 attributes
  • core/post-data - Handles post entities using block context
  • core/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

  1. Enhance Post Data source to support attribute-based data retrieval and add link key support for post-type entities
  2. Enhance Term Data source to support attribute-based data retrieval (already has link key for taxonomy entities)
  3. Update Navigation Link hook to programmatically choose between Post/Term bindings based on the kind attribute (post-typecore/post-data, taxonomycore/term-data)
  4. 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.

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions