# getwid/2.0.13/includes/blocks/button-group.php

Getwid – Gutenberg Blocks, version 2.0.13. 58 lines.

- Page: https://pluginprobe.com/plugins/getwid/2.0.13/code/includes/blocks/button-group.php
- Raw: https://pluginprobe.com/plugins/getwid/2.0.13/raw/includes/blocks/button-group.php
- Modified: 2024-10-25T10:23:02+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/getwid/2.0.13/code/includes/blocks/button-group.php#L10-L20`.

```php
<?php

namespace Getwid\Blocks;

class ButtonGroup extends \Getwid\Blocks\AbstractBlock {

	protected static $blockName = 'getwid/button-group';

	public function __construct() {

		parent::__construct( self::$blockName );

		register_block_type(
			'getwid/button-group',
			array(
				'render_callback' => [ $this, 'render_callback' ]
			)
		);

	}

	public function getLabel() {
		return __('Button Group', 'getwid');
	}

    public function block_frontend_assets() {

    	if ( is_admin() ) {
			return;
		}

		if ( FALSE == getwid()->assetsOptimization()->load_assets_on_demand() ) {
			return;
		}

		$rtl = is_rtl() ? '.rtl' : '';

		wp_enqueue_style(
			self::$blockName,
			getwid_get_plugin_url( 'assets/blocks/button-group/style' . $rtl . '.css' ),
			[],
			getwid()->settings()->getVersion()
		);
	}

    public function render_callback( $attributes, $content ) {

    	$this->block_frontend_assets();

		return $content;
	}

}

getwid()->blocksManager()->addBlock(
	new \Getwid\Blocks\ButtonGroup()
);

```
