block_bindings_source_value
Filter HookDescription
Filters the output of a block bindings source.Hook Information
File Location |
wp-includes/class-wp-block-bindings-source.php
View on GitHub
|
Hook Type | Filter |
Line Number | 98 |
Hook Parameters
Type | Name | Description |
---|---|---|
mixed
|
$value
|
The computed value for the source. |
string
|
$name
|
The name of the source. |
array
|
$source_args
|
Array containing source arguments used to look up the override value, i.e. { "key": "foo" }. |
WP_Block
|
$block_instance
|
The block instance. |
string
|
$attribute_name
|
The name of an attribute. |
Usage Examples
Basic Usage
<?php
// Hook into block_bindings_source_value
add_filter('block_bindings_source_value', 'my_custom_filter', 10, 5);
function my_custom_filter($value, $name, $source_args, $block_instance, $attribute_name) {
// Your custom filtering logic here
return $value;
}
Source Code Context
wp-includes/class-wp-block-bindings-source.php:98
- How this hook is used in WordPress core
<?php
93 * @param string $name The name of the source.
94 * @param array $source_args Array containing source arguments used to look up the override value, i.e. { "key": "foo" }.
95 * @param WP_Block $block_instance The block instance.
96 * @param string $attribute_name The name of an attribute.
97 */
98 return apply_filters( 'block_bindings_source_value', $value, $this->name, $source_args, $block_instance, $attribute_name );
99 }
100
101 /**
102 * Wakeup magic method.
103 *
PHP Documentation
<?php
/**
* Filters the output of a block bindings source.
*
* @since 6.7.0
*
* @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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 5
- File: wp-includes/class-wp-block-bindings-source.php
Related Hooks
Related hooks will be displayed here in future updates.