block_bindings_source_value хук-фильтрWP 6.7.0

Filters the output of a block bindings source.

Использование

add_filter( 'block_bindings_source_value', 'wp_kama_block_bindings_source_value_filter', 10, 5 );

/**
 * Function for `block_bindings_source_value` filter-hook.
 * 
 * @param mixed    $value          The computed value for the source.
 * @param string   $name           The name of the source.
 * @param array    $source_args    Array containing source arguments used to look up the override value, i.e. { "key": "foo" }.
 * @param WP_Block $block_instance The block instance.
 * @param string   $attribute_name The name of an attribute.
 *
 * @return mixed
 */
function wp_kama_block_bindings_source_value_filter( $value, $name, $source_args, $block_instance, $attribute_name ){

	// filter...
	return $value;
}
$value(разное)
The computed value for the source.
$name(строка)
The name of the source.
$source_args(массив)
Array containing source arguments used to look up the override value, i.e. { "key": "foo" }.
$block_instance(WP_Block)
The block instance.
$attribute_name(строка)
The name of an attribute.

Список изменений

С версии 6.7.0 Введена.

Где вызывается хук

WP_Block_Bindings_Source::get_value()
block_bindings_source_value
wp-includes/class-wp-block-bindings-source.php 98
return apply_filters( 'block_bindings_source_value', $value, $this->name, $source_args, $block_instance, $attribute_name );

Где используется хук в WordPress

Использование не найдено.