<?php
/**
 * File Path: templates/partials/teaser.php
 *
 * Teaser Partial
 *
 * Displays the short marketing teaser from mbs_teaser postmeta.
 * All strings properly escaped and prepared for translation (GP-LANG-1).
 *
 * @package MyBookShowroom
 * @since   1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! mbs_is_registered() ) {
	return;
}

if ( ! isset( $post_id ) ) {
	$post_id = get_the_ID();
}

$teaser = get_post_meta( $post_id, 'mbs_teaser', true ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- template-scope variable; not a global

if ( ! empty( $teaser ) ) {
	echo '<div class="mbs-wrapper">';
	echo '<div class="mbs-teaser">';
	echo wp_kses_post( $teaser );
	echo '</div>';
	echo '</div>';
}
?>
