# ablocks/trunk/addons/theme-builder/shortcode.php

aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder &amp; Animation Builder, version trunk. 39 lines.

- Page: https://pluginprobe.com/plugins/ablocks/trunk/code/addons/theme-builder/shortcode.php
- Raw: https://pluginprobe.com/plugins/ablocks/trunk/raw/addons/theme-builder/shortcode.php
- Modified: 2025-08-05T15:00:28+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/ablocks/trunk/code/addons/theme-builder/shortcode.php#L10-L20`.

```php
<?php
namespace ABlocksThemeBuilder;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use ABlocksThemeBuilder\Traits\RenderContent;

class Shortcode {
	use RenderContent;

	public static function init() {
		$self = new self();
		add_shortcode( 'ablocks_template', [ $self, 'render_template' ] );
	}
	public function render_template( $attributes ) {
		$attributes = shortcode_atts(
			[
				'id' => '',
			],
			$attributes,
			'ablocks_template'
		);

		$id = ! empty( $attributes['id'] ) ? apply_filters( 'ablocks/theme_builder/render_template_id', intval( $attributes['id'] ) ) : '';

		if ( empty( $id ) ) {
			return '';
		}
		add_filter( 'ablocks/is_allow_block_inline_assets', '__return_true' );
		add_filter( 'ablocks/is_enabled_assets_generation', '__return_false' );
		$content = $this->get_rendered_block_content_by_id( $id );
		remove_filter( 'ablocks/is_allow_block_inline_assets', '__return_true' );
		remove_filter( 'ablocks/is_enabled_assets_generation', '__return_false' );
		return $content;
	}
}

```
