<?php
/**
 * @category    FishPig
 * @package     FishPig_WordPress
 * @author      Ben Tideswell <help@fishpig.co.uk>
 */
// phpcs:ignoreFile -- long lines (todo)
/**
 * Add filters using hidden inputs:
 *
 * <input type="hidden" name="cat" value="enter_category_slug" />
 * <input type="hidden" name="tag" value="enter_tag_slug" />
 */
?>
<div class="block block-blog block-blog-search">
    <?php if ($title = $block->getTitle()): ?>
        <div class="block-title">
            <strong><?= $block->escapeHtml(__($title)) ?></strong>
        </div>
    <?php endif; ?>
    <div class="block-content">
        <form method="get" action="<?= $block->escapeUrl($block->getFormActionUrl()) ?>" id="blog-search-form">
            <?php if ($block->getPostType()): ?>
                <input type="hidden" name="post_type" value="<?= $block->escapeHtml($block->getPostType()) ?>"/>
            <?php endif; ?>
            <fieldset class="fieldset">
                <div class="field required">
                    <div class="control">
                        <input type="text" name="s" class="input-text" value="<?= $block->escapeHtml($block->getSearchTerm()) ?>" placeholder="<?= $block->escapeHtml(__('Search blog...')) ?>"/>
                    </div>
                </div>
            </fieldset>
            <div class="actions-toolbar">
                <div class="primary">
                    <button type="submit" name="submit"  class="action submit primary">
                    <span><?= $block->escapeHtml(__('Search')) ?></span>
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>
