File: /var/www/fintechfuelwordpressapi/public/wp-content/themes/intentionally-blank/functions.php
<?php
require_once __DIR__ . '/lib/blankTheme.php';
require_once __DIR__ . '/lib/api.php';
add_shortcode('quote', 'quoteShortCode');
function quoteShortCode(array $attributes): string
{
$quoteId = $attributes['id'] ?? null;
if (empty($quoteId)) {
return '';
}
$quoteId--;
$postId = get_the_ID();
$quotes = get_field('quotes', $postId);
if (empty($quotes) || empty($quotes[$quoteId])) {
return '';
}
$quote = $quotes[$quoteId];
$html = '';
$shotCodeTemplateFileName = __DIR__ . '/templates/authors_quote.php';
if (file_exists($shotCodeTemplateFileName)) {
ob_start();
require $shotCodeTemplateFileName;
$html .= ob_get_clean();
}
return $html;
}