Title: WP_Block_Bindings_Source::__construct
Published: April 3, 2024
Last modified: April 28, 2025

---

# WP_Block_Bindings_Source::__construct( string $name, array $source_properties )

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/__construct/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/__construct/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/__construct/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/__construct/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/__construct/?output_format=md#changelog)

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

Constructor.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wp_block_bindings_source/__construct/?output_format=md#description)󠁿

Do not use this constructor directly. Instead, use the `WP_Block_Bindings_Registry::
register` method or the `register_block_bindings_source` function.

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

 `$name`stringrequired

The name of the source.

`$source_properties`arrayrequired

The properties of the source.

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

    ```php
    public function __construct( string $name, array $source_properties ) {
    	$this->name = $name;
    	foreach ( $source_properties as $property_name => $property_value ) {
    		$this->$property_name = $property_value;
    	}
    }
    ```

[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#L65)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-block-bindings-source.php#L65-L70)

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

| Used by | Description | 
| [WP_Block_Bindings_Registry::register()](https://developer.wordpress.org/reference/classes/wp_block_bindings_registry/register/)`wp-includes/class-wp-block-bindings-registry.php` |

Registers a new block bindings source.

  |

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

| Version | Description | 
| [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%2F__construct%2F)
before being able to contribute a note or feedback.