# speechkit/7.0.0/src/editor/components/block-attributes/addAttributes.js

BeyondWords – AI audio for publishers, version 7.0.0. 48 lines.

- Page: https://pluginprobe.com/plugins/speechkit/7.0.0/code/src/editor/components/block-attributes/addAttributes.js
- Raw: https://pluginprobe.com/plugins/speechkit/7.0.0/raw/src/editor/components/block-attributes/addAttributes.js
- Modified: 2026-08-12T09:46:22+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/speechkit/7.0.0/code/src/editor/components/block-attributes/addAttributes.js#L10-L20`.

```javascript
/**
 * WordPress Dependencies
 */
import { addFilter } from '@wordpress/hooks';

/**
 * Internal dependencies
 */
import { isBeyondwordsSupportedBlock } from './isBeyondwordsSupportedBlock';

/**
 * Register custom block attributes for BeyondWords.
 *
 * @since 4.0.4 Remove settings.attributes undefined check, to match official docs.
 * @since 6.0.1 Skip internal/UI blocks to prevent breaking the block inserter.
 *
 * @param {Object} settings Settings for the block.
 * @param {string} name     Block name.
 *
 * @return {Object} settings Modified settings.
 */
function addAttributes( settings, name ) {
	if ( ! isBeyondwordsSupportedBlock( name ) ) {
		return settings;
	}

	return {
		...settings,
		attributes: {
			...settings.attributes,
			beyondwordsAudio: {
				type: 'boolean',
				default: true,
			},
			beyondwordsMarker: {
				type: 'string',
				default: '',
			},
		},
	};
}

addFilter(
	'blocks.registerBlockType',
	'beyondwords/beyondwords-block-attributes',
	addAttributes
);

```
