# jetformbuilder/3.6.4/modules/shortcode/shortcode.php

JetFormBuilder — Dynamic Blocks Form Builder, version 3.6.4. 38 lines.

- Page: https://pluginprobe.com/plugins/jetformbuilder/3.6.4/code/modules/shortcode/shortcode.php
- Raw: https://pluginprobe.com/plugins/jetformbuilder/3.6.4/raw/modules/shortcode/shortcode.php
- Modified: 2024-02-08T14:44:24+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/jetformbuilder/3.6.4/code/modules/shortcode/shortcode.php#L10-L20`.

```php
<?php


namespace JFB_Modules\Shortcode;

use JFB_Components\Repository\Repository_Item_Instance_Trait;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

abstract class Shortcode implements Repository_Item_Instance_Trait {

	public function __construct() {
		add_shortcode( $this->get_name(), array( $this, 'add_shortcode_callback' ) );
	}

	abstract public function get_name();

	abstract public function generate( $settings );

	public function rep_item_id() {
		return $this->get_name();
	}

	protected function default_args() {
		return array();
	}

	public function add_shortcode_callback( $atts ) {
		$settings = shortcode_atts( $this->default_args(), $atts, $this->get_name() );

		return $this->generate( $settings );
	}

}

```
