Make WordPress Core

Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#64112 closed defect (bug) (fixed)

Block Bindings: Use `field` instead of `key` for post-data and term-data sources.

Reported by: cbravobernal Owned by: cbravobernal
Priority: normal Milestone: 6.9
Component: General Version:
Severity: normal Keywords: gutenberg-merge has-patch
Cc: Focuses:

Description

The first use case for block bindings was post-meta source. This one keeps a key - value relation, which makes totally sense. But all examples for Block Bindings have been done with this key argument, and the UI was pretty key dependant.

After the UI refactor, args can contain anything, and using the argument that fits better for each source is encouraged.

For post-meta and term-data, key may not be the best, as it will connect in a future to different fields.

The source has been introduced during 6.9 cycle, but lived inside Gutenberg for a couple of versions, so I added backward compatibility with key only for the Gutenberg plugin, that way we cover:

WP 6.8.X and 6.7.X versions that used the new post-date approach with Gutenberg enabled.
WP 6.9 without GB will use the migration to the new post-date with field.
WP 6.9 with GB enabled.

Change History (10)

#2 @cbravobernal
12 months ago

  • Owner set to cbravobernal
  • Resolution → fixed
  • Status assigned → closed

In 60955:

Block Bindings: Use field instead of key in post-data source.

After the UI refactor, source args can contain anything, and using whatever fits better for each source is encouraged.
Instead of using a post-meta based key argument. post-data will use field as an argument, which fits better to post related use cases.

Props cbravobernal, bernhard-reiter.
Fixes #64112.

#4 @cbravobernal
12 months ago

In 60957:

Block Bindings: Migrate Add link field link source key to field.

[60955] moved post-data key args to a better fit field one. Adds a forgotten in that changeset link to that field check.

Props bernhard-reiter.
Fixes #64112.

#6 @cbravobernal
12 months ago

  • Summary Block Bindings: Use `field` instead of `key` for post-data source. → Block Bindings: Use `field` instead of `key` for post-data and term-data sources.

#7 @cbravobernal
12 months ago

  • Resolution fixed
  • Status closed → reopened

This ticket was mentioned in ​PR #10326 on ​WordPress/wordpress-develop by ​@cbravobernal.


12 months ago
#8

Adds new field argument for term-data source.

Trac ticket: https://core.trac.wordpress.org/ticket/64112

#9 @cbravobernal
12 months ago

  • Resolution → fixed
  • Status reopened → closed

In 60958:

Block Bindings: Migrate term-data from key args to field.

Adds new field argument for term-data source.

Props bernhard-reiter.
Fixes #64112.

#10 @sabernhardt
12 months ago

  • Milestone Awaiting Review → 6.9
Note: See TracTickets for help on using tickets.