<?php
/**
 * Tag List - Template
 * 
 * @package OrokuBlocks
 * @author OrokuBlocks (https://orokublocks.com/)
 * 
 * @since 1.0.0
 * 
 * @param array $args {
 *   @type array  $tags {
 *      @type string $name    Tag name.
 *      @type string $theme   Tag theme.
 *   }
 *   @type string $size       Tag size.
 * }
 */

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
  exit;
}

$defaults = [
  'tags'  => [],
  'size'  => 'regular'
];

$options = array_merge( $defaults, $args );

?>
<?php if ( count($options['tags']) > 0 ) : ?>
  <ul class="oroku-tag-list">
  <?php foreach ( $options['tags'] as $tag ) : ?>
    <li class="oroku-tag-list__item oroku-tag-list__item--size--<?php echo esc_attr( $options['size'] ); ?> oroku-tag-list__item--theme--<?php echo esc_attr( $tag['theme'] ); ?>">
      <span class="oroku-tag-list__text"><?php echo esc_html( $tag['name'] ); ?></span>
    </li>
  <?php endforeach; ?>
  </ul>
<?php endif; ?>