# automatic-youtube-gallery/2.9.1/block/src/helper.js

Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists &amp; Channels, version 2.9.1. 46 lines.

- Page: https://pluginprobe.com/plugins/automatic-youtube-gallery/2.9.1/code/block/src/helper.js
- Raw: https://pluginprobe.com/plugins/automatic-youtube-gallery/2.9.1/raw/block/src/helper.js
- Modified: 2023-05-13T11:39:00+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/automatic-youtube-gallery/2.9.1/code/block/src/helper.js#L10-L20`.

```javascript
/**
 * Get block attributes 
 */
export function getBlockAttributes() {
	var attributes = {
		is_admin: {
			type: 'boolean',
			default: false
		},
		uid: {
			type: 'string',
			default: ''
		}
	};
	
	for ( var key in ayg_block.options ) {
		var fields = ayg_block.options[ key ].fields;

		for ( var field in fields ) {
			var name = fields[ field ].name;

			attributes[ name ] = {
				type: getType( fields[ field ].type ),
				default: fields[ field ].value
			};
		}
	}

	return attributes;
}

/**
 * Get attribute type
 */
function getType( type ) {
	var _type = 'string';

	if ( 'number' == type ) {
		_type = 'number';
	} else if ( 'checkbox' == type ) {
		_type = 'boolean';
	}

	return _type;
}

```
