<?php
/**
 * Name: Pullquote
 * Description: Pullquotes for AUX
 * Alias: pulltext
 *
 * Example usage:
 * ```
 * [pullquote name="Name" title="Title" organization="Organization" long="true"]
 * This is a pullquote.
 * [/pullquote]
 * ```
 * or, using the alias "pulltext":
 * ```
 * [pulltext name="Name" title="Title" organization="Organization" long="true"]
 * This is a pullquote.
 * [/pulltext]
 * ```
 *
 * @var string $content Text content of the quote
 * @var array{
 *   name: string|null,
 *   title: string|null,
 *   organization: string|null,
 *   long: string|int|bool|null
 * } $attributes
 */

declare(strict_types=1);

use WP_AUX\Entities\AuxFramework\Partials\QuoteEntity;

$pullquote = QuoteEntity::createPullquote($content)
  ->setCitation($attributes);

if (isset($attributes['long'])) {
  $pullquote->setIsLong($attributes['long']);
}

echo $pullquote;
