# getwid/3.0.2/includes/blocks/section.php

Getwid – Gutenberg Blocks, version 3.0.2. 55 lines.

- Page: https://pluginprobe.com/plugins/getwid/3.0.2/code/includes/blocks/section.php
- Raw: https://pluginprobe.com/plugins/getwid/3.0.2/raw/includes/blocks/section.php
- Modified: 2026-08-28T10:51:30+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/3.0.2/code/includes/blocks/section.php#L10-L20`.

```php
<?php

namespace Getwid\Blocks;

class Section extends AbstractBlock {

	public function __construct() {

		parent::__construct( 'getwid/section' );

		register_block_type(
			getwid_get_plugin_path( 'assets/blocks/section' ),
			array(
				'render_callback' => array( $this, 'render_callback' ),
			)
		);
	}

	public function get_label() {
		return __( 'Section', 'getwid' );
	}

	public function block_frontend_assets( $attributes = array(), $content = '' ) {

		if ( is_admin() ) {
			return;
		}

		$has_background_slider = false !== strpos( $content, 'wp-block-getwid-section__background-slider-item' );

		if ( ! empty( $attributes['entranceAnimation'] ) ) {
			wp_enqueue_script( 'wow' );
			wp_enqueue_style( 'animate' );
		}

		if ( $has_background_slider ) {
			wp_enqueue_script( 'slick' );
			wp_enqueue_style( 'slick' );
			wp_enqueue_style( 'slick-theme' );
			wp_enqueue_script( 'imagesloaded' );
		}
	}

	public function render_callback( $attributes, $content ) {

		$this->block_frontend_assets( $attributes, $content );

		return $content;
	}
}

getwid()->blocksManager()->addBlock(
	new Section()
);

```
