<?php
/**
 * Frontend output for the AUX Footer Column - Paragraph block
 * This is only to be used for footers and should not be brought in to the main page builder
 *
 * AUX documentation: https://aggieux.tamu.edu/?path=/docs/navigation-footers-footer-option-a-about-footer-option-a--docs
 *
 * Outline:
 * 1. Set variables to null
 * 2. Get fields from the post, if they have values, wrap in html
 * 3. Build the component html
 * 4. Sanitize and output
 *
 * @author Hailey Sanders
 * @since 1.0.0
 */

use WP_AUX\Services\HtmlService;

// Get fields from the post, if they have values, wrap in html
$footerColumnHeading = aux_get_field('footer_column_heading');
$footerColumnContent = aux_get_field('footer_column_content');

$footerColumnHeading = HtmlService::formattedValue($footerColumnHeading, '<span class="column__header">%s</span> ');

// Build the component HTML
$output = <<<HTML
<div class="footer__column">
    $footerColumnHeading
    $footerColumnContent
</div>
HTML;

// Sanitize and output
echo $output;
