block_bindings_source_value filter-hookWP 6.7.0

Filters the output of a block bindings source.

Usage

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(mixed)
The computed value for the source.
$name(string)
The name of the source.
$source_args(array)
Array containing source arguments used to look up the override value, i.e. { "key": "foo" }.
$block_instance(WP_Block)
The block instance.
$attribute_name(string)
The name of an attribute.

Changelog

Since 6.7.0 Introduced.

Where the hook is called

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 );

Where the hook is used in WordPress

Usage not found.