Block Bindings: Migrate term-data from key args to field.
Adds new `field` argument for term-data source. Props bernhard-reiter. Fixes #64112. Built from https://develop.svn.wordpress.org/trunk@60958 git-svn-id: http://core.svn.wordpress.org/trunk@60294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -14,12 +14,12 @@
|
||||
* @access private
|
||||
*
|
||||
* @param array $source_args Array containing source arguments used to look up the override value.
|
||||
* Example: array( "key" => "name" ).
|
||||
* Example: array( "field" => "name" ).
|
||||
* @param WP_Block $block_instance The block instance.
|
||||
* @return mixed The value computed for the source.
|
||||
*/
|
||||
function _block_bindings_term_data_get_value( array $source_args, $block_instance ) {
|
||||
if ( empty( $source_args['key'] ) ) {
|
||||
if ( empty( $source_args['field'] ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ function _block_bindings_term_data_get_value( array $source_args, $block_instanc
|
||||
}
|
||||
}
|
||||
|
||||
switch ( $source_args['key'] ) {
|
||||
switch ( $source_args['field'] ) {
|
||||
case 'id':
|
||||
return esc_html( (string) $term_id );
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.9-alpha-60957';
|
||||
$wp_version = '6.9-alpha-60958';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Reference in New Issue
Block a user