_register_block_bindings_term_data_source()WP 6.9.0

Registers Term Data source in the block bindings registry.

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Returns

null. Nothing (null).

Usage

_register_block_bindings_term_data_source();

Changelog

Since 6.9.0 Introduced.

_register_block_bindings_term_data_source() code WP 6.9.1

function _register_block_bindings_term_data_source() {
	if ( get_block_bindings_source( 'core/term-data' ) ) {
		// The source is already registered.
		return;
	}

	register_block_bindings_source(
		'core/term-data',
		array(
			'label'              => _x( 'Term Data', 'block bindings source' ),
			'get_value_callback' => '_block_bindings_term_data_get_value',
			'uses_context'       => array( 'termId', 'taxonomy' ),
		)
	);
}