W3cubDocs

/WordPress

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

Constructor.

Description

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

Parameters

$namestringrequired
The name of the source.
$source_propertiesarrayrequired
The properties of the source.

Source

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

Changelog

Version Description
6.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_block_bindings_source/__construct