storeSettings = new StoreSettings(); } public function getStoreLogo(): string { return $this->storeSettings->get('store_logo.url', ''); } public function getStoreName(): string { return $this->storeSettings->get('store_name', get_bloginfo('name')); } public function render(array $atts = []): void { $defaults = [ 'is_shortcode' => false ]; $atts = wp_parse_args($atts, $defaults); $isLink = Helper::toBool(Arr::get($atts, 'is_link', true), true); $isShortcode = Helper::toBool(Arr::get($atts, 'is_shortcode', false)); // Custom logo from block attributes $customLogoUrl = Arr::get($atts, 'logo_url', ''); $atts['logo_url'] = !empty($customLogoUrl) ? $customLogoUrl : $this->getStoreLogo(); $atts['store_name'] = $this->getStoreName(); $wrapperAttributes = ''; if (!$isShortcode) { $wrapperAttributes = RenderHelper::getBlockWrapperAttributes([ 'class' => 'fct-store-logo-wrapper' ]); } ?>
> renderWithLink($atts); } else { $this->renderWithoutLink($atts); } ?>
renderLogoContent($atts); ?> renderTextFallback($storeName); return; } $this->renderImage($atts); } protected function renderImage(array $atts): void { $maxWidth = absint(Arr::get($atts, 'max_width')); $maxHeight = absint(Arr::get($atts, 'max_height')); // Fallback to defaults if empty or invalid $maxWidth = $maxWidth > 0 ? $maxWidth : 150; $maxHeight = $maxHeight > 0 ? $maxHeight : 70; $style = sprintf( '--max-width:%dpx; --max-height:%dpx;', $maxWidth, $maxHeight ); ?> <?php echo esc_attr($atts['store_name']); ?>