3, 'title' => __('Rooster One Store Hero', 'ai-eshop-optimizer'), 'description' => __('Shop-page header hero in the category-hero style (centred image, title, horizontal line). Listing title, heading and description come from the bound location. Auto-resolves on a store page, or set a location slug.', 'ai-eshop-optimizer'), 'category' => 'widgets', 'icon' => 'store', 'keywords' => array('store', 'shop', 'hero', 'header', 'location'), 'supports' => array('align' => array('wide', 'full'), 'anchor' => true), 'attributes' => array( 'locationSlug' => array('type' => 'string', 'default' => ''), 'layout' => array('type' => 'string', 'default' => '', 'enum' => array('', 'shop')), ), 'uses_context' => array('postId'), 'render_callback' => array(__CLASS__, 'render'), )); } public static function shortcode($atts) { $atts = shortcode_atts(array('location' => ''), $atts, 'aieo_store_hero'); return self::render(array('locationSlug' => (string) $atts['location'])); } public static function render($attrs, $content = '', $block = null) { if (!class_exists('AIEO_Google_Reviews_Helpers')) { return ''; } $attrs = wp_parse_args(is_array($attrs) ? $attrs : array(), array('locationSlug' => '', 'layout' => '')); if ('shop' === $attrs['layout']) { $pid = class_exists('AIEO_Store_Page') ? AIEO_Store_Page::store_id($block) : 0; return $pid ? AIEO_Store_Page_Blocks::head($pid, $block) : ''; } $loc = AIEO_Google_Reviews_Helpers::resolve_single($attrs['locationSlug'], $block); if (!$loc) { return ''; } wp_enqueue_style(self::STYLE_HANDLE); $title = trim((string) ($loc['listing_title'] ?? '')); $headline = trim((string) ($loc['hero_heading'] ?? '')); $desc = trim((string) ($loc['hero_description'] ?? '')); $image = trim((string) ($loc['image_url'] ?? '')); if ($title === '') { $title = (string) ($loc['label'] ?? ''); } if ($title === '' && is_singular()) { $title = (string) get_the_title(get_queried_object_id()); } if ($title === '' && $headline === '' && $desc === '') { return ''; } $img_html = ''; if ($image !== '') { $img_html = '' . esc_attr($title) . ''; } $classes = array('aieo-category-hero', 'aieo-category-hero--default', 'aieo-store-hero'); if ($headline === '') { $classes[] = 'aieo-category-hero--no-headline'; } if ($desc === '') { $classes[] = 'aieo-category-hero--no-description'; } $wrap_class = get_block_wrapper_attributes(array('class' => implode(' ', $classes))); ob_start(); ?>
data-template="default">

array('src' => array(), 'alt' => array(), 'class' => array(), 'loading' => array(), 'width' => array(), 'height' => array()))); ?>

.wp-block-column{min-width:0;max-width:none;margin:0;flex:none}' . '.ff-store-row>.wp-block-column>.wp-block-heading{text-align:start!important}' . '@media(min-width:1680px){' . '.ff-store-row{grid-template-columns:3fr 1fr 3fr 1fr 3fr;gap:0!important}' . '.ff-store-row>.wp-block-column:nth-of-type(1){grid-column:1}' . '.ff-store-row>.wp-block-column:nth-of-type(2){grid-column:3}' . '.ff-store-row>.wp-block-column:nth-of-type(3){grid-column:5}' . '.ff-store-row .aieo-loc-hours-block .aieo-loc__hours{justify-content:end}' . '.ff-store-row>.wp-block-column:nth-of-type(2)>.wp-block-heading{text-align:center!important}' . '.ff-store-row>.wp-block-column:nth-of-type(3)>.wp-block-heading{text-align:right!important}' . '}'; wp_register_style('aieo-store-band', false, array(), null); wp_add_inline_style('aieo-store-band', $css); wp_enqueue_style('aieo-store-band'); } }