# ablocks/2.8.0/includes/frontend/dynamic-content/interpreters/shortcode.php

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

- Page: https://pluginprobe.com/plugins/ablocks/2.8.0/code/includes/frontend/dynamic-content/interpreters/shortcode.php
- Raw: https://pluginprobe.com/plugins/ablocks/2.8.0/raw/includes/frontend/dynamic-content/interpreters/shortcode.php
- Modified: 2025-04-09T16:19:26+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/2.8.0/code/includes/frontend/dynamic-content/interpreters/shortcode.php#L10-L20`.

```php
<?php
namespace ABlocks\Frontend\DynamicContent\Interpreters;

use ABlocks\Helper;
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
class Shortcode extends Abstracts\Interpreter {
	protected string $shortcode;
	protected string $pre;
	protected string $post;
	protected string $default;

	public function __construct( string $name, array $setting, bool $is_richtext = false ) {
		parent::__construct( $name, $setting, $is_richtext );
		$this->shortcode = strval( $this->setting[0] ?? '' );
		$this->pre     = strval( $this->setting[3] ?? '' );
		$this->post    = strval( $this->setting[4] ?? '' );
		$this->default = strval( $this->setting[5] ?? '' );
	}
	public function content() : string {
		$this->content = do_shortcode( $this->shortcode );
		return $this->pre . ( $this->content === '' ? $this->default : $this->content ) . $this->post;
	}
	public function req_param_value( array $params ) : string {
		return sanitize_text_field( $params[ $this->param ] ?? '' );
	}
}

```
