You are here

class Shortcode in Shortcode 8

Same name in this branch
  1. 8 src/Annotation/Shortcode.php \Drupal\shortcode\Annotation\Shortcode
  2. 8 src/Plugin/Filter/Shortcode.php \Drupal\shortcode\Plugin\Filter\Shortcode
Same name and namespace in other branches
  1. 2.0.x src/Annotation/Shortcode.php \Drupal\shortcode\Annotation\Shortcode

Defines an shortcode annotation object.

Plugin Namespace: Plugin\Shortcode.

For a working example, see \Drupal\shortcode_example\Plugin\Shortcode\BootstrapColumnShortcode

Hierarchy

Expanded class hierarchy of Shortcode

See also

\Drupal\shortcode\ShortcodePluginManager

\Drupal\shortcode\Plugin\ShortcodeInterface

\Drupal\shortcode\Plugin\ShortcodeBase

Plugin API

1 string reference to 'Shortcode'
shortcode.info.yml in ./shortcode.info.yml
shortcode.info.yml
11 classes are annotated with Shortcode
BlockShortcode in shortcode_basic_tags/src/Plugin/Shortcode/BlockShortcode.php
Insert div or span around the text with some css classes.
BootstrapColumnShortcode in shortcode_example/src/Plugin/Shortcode/BootstrapColumnShortcode.php
Provides a shortcode for bootstrap columns.
ButtonShortcode in shortcode_basic_tags/src/Plugin/Shortcode/ButtonShortcode.php
The image shortcode.
ClearShortcode in shortcode_basic_tags/src/Plugin/Shortcode/ClearShortcode.php
Insert div or span around the text with some css classes.
DropcapShortcode in shortcode_basic_tags/src/Plugin/Shortcode/DropcapShortcode.php
Replace the given text formatted like as a dropcap.

... See full list

File

src/Annotation/Shortcode.php, line 22

Namespace

Drupal\shortcode\Annotation
View source
class Shortcode extends Plugin {

  /**
   * The plugin ID.
   *
   * This is used in the backend to identify shortcodes, not used for parsing.
   *
   * @var string
   */
  public $id;

  /**
   * The shortcode token.
   *
   * This is used to parse the shortcode. If not defined, defaults to $id.
   *
   * @var string
   */
  public $token;

  /**
   * The name of the provider that owns the shortcode.
   *
   * @var string
   */
  public $provider;

  /**
   * The human-readable name of the shortcode.
   *
   * This is used as an administrative summary of what the shortcode does.
   *
   * @var \Drupal\Core\Annotation\Translation
   * @ingroup plugin_translatable
   */
  public $title;

  /**
   * Additional administrative information about the shortcode's behavior.
   *
   * @var \Drupal\Core\Annotation\Translation
   *  (optional)
   * @ingroup plugin_translatable
   */
  public $description;

  /**
   * Whether this shortcode is enabled or disabled by default.
   *
   * @var bool
   *  (optional)
   */
  public $status = TRUE;

  /**
   * Weight of this shortcode.
   *
   * Shortcodes with lower weights are processed
   * first.
   *
   * @var int
   *  (optional)
   */
  public $weight = 99;

  /**
   * The default settings for the shortcode.
   *
   * @var array
   *  (optional)
   */
  public $settings = [];

}

Members

Namesort descending Modifiers Type Description Overrides
Plugin::$definition protected property The plugin definition read from the class annotation. 1
Plugin::get public function Gets the value of an annotation. Overrides AnnotationInterface::get 5
Plugin::getClass public function Gets the class of the annotated class. Overrides AnnotationInterface::getClass
Plugin::getId public function Gets the unique ID for this annotated class. Overrides AnnotationInterface::getId
Plugin::getProvider public function Gets the name of the provider of the annotated class. Overrides AnnotationInterface::getProvider
Plugin::parse protected function Parses an annotation into its definition.
Plugin::setClass public function Sets the class of the annotated class. Overrides AnnotationInterface::setClass
Plugin::setProvider public function Sets the name of the provider of the annotated class. Overrides AnnotationInterface::setProvider
Plugin::__construct public function Constructs a Plugin object. 2
Shortcode::$description public property Additional administrative information about the shortcode's behavior.
Shortcode::$id public property The plugin ID.
Shortcode::$provider public property The name of the provider that owns the shortcode.
Shortcode::$settings public property The default settings for the shortcode.
Shortcode::$status public property Whether this shortcode is enabled or disabled by default.
Shortcode::$title public property The human-readable name of the shortcode.
Shortcode::$token public property The shortcode token.
Shortcode::$weight public property Weight of this shortcode.