Title: WP_Block_Bindings_Source::get_value
Published: April 3, 2024
Last modified: February 24, 2026

---

# WP_Block_Bindings_Source::get_value( array $source_args, WP_Block $block_instance, string $attribute_name ): mixed

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/get_value/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/get_value/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/get_value/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/get_value/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/get_value/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/get_value/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/get_value/?output_format=md#wp--skip-link--target)

Calls the callback function specified in the `$get_value_callback` property with
the given arguments and returns the result. It can be modified with `block_bindings_source_value`
filter.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/get_value/?output_format=md#parameters)󠁿

 `$source_args`arrayrequired

Array containing source arguments used to look up the override value, i.e. {"key":"
foo"}.

`$block_instance`[WP_Block](https://developer.wordpress.org/reference/classes/wp_block/)
required

The block instance.

`$attribute_name`stringrequired

The name of the target attribute.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/get_value/?output_format=md#return)󠁿

 mixed The value of the source.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/get_value/?output_format=md#source)󠁿

    ```php
    public function get_value( array $source_args, $block_instance, string $attribute_name ) {
    	$value = call_user_func_array( $this->get_value_callback, array( $source_args, $block_instance, $attribute_name ) );
    	/**
    	 * 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.
    	 */
    	return apply_filters( 'block_bindings_source_value', $value, $this->name, $source_args, $block_instance, $attribute_name );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-block-bindings-source.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-block-bindings-source.php#L85)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-block-bindings-source.php#L85-L99)

## 󠀁[Hooks](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/get_value/?output_format=md#hooks)󠁿

 [apply_filters( ‘block_bindings_source_value’, mixed $value, string $name, array $source_args, WP_Block $block_instance, string $attribute_name )](https://developer.wordpress.org/reference/hooks/block_bindings_source_value/)

Filters the output of a block bindings source.

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/get_value/?output_format=md#related)󠁿

| Uses | Description | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/get_value/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.7.0](https://developer.wordpress.org/reference/since/6.7.0/) | `block_bindings_source_value` filter was added. | 
| [6.5.0](https://developer.wordpress.org/reference/since/6.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_block_bindings_source%2Fget_value%2F)
before being able to contribute a note or feedback.