PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.1
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.1
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
fluent-cart / app / Hooks / Handlers / BlockEditors / StoreLogoBlockEditor.php

StoreLogoBlockEditor.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.6.1, at app/Hooks/Handlers/BlockEditors/StoreLogoBlockEditor.php

56 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\App\Hooks\Handlers\BlockEditors;
4
5 use FluentCart\App\Services\Renderer\StoreLogoRenderer;
6 use FluentCart\App\Services\Translations\TransStrings;
7 use FluentCart\App\Vite;
8
9 class StoreLogoBlockEditor extends BlockEditor
10 {
11 protected static string $editorName = 'store-logo';
12
13 public function getScripts(): array
14 {
15 return [
16 [
17 'source' => 'admin/BlockEditor/StoreLogo/StoreLogoBlockEditor.jsx',
18 'dependencies' => ['wp-blocks', 'wp-components']
19 ]
20 ];
21 }
22
23 public function getStyles(): array
24 {
25 return [];
26 }
27
28 public function localizeData(): array
29 {
30 $renderer = new StoreLogoRenderer();
31
32 return [
33 $this->getLocalizationKey() => [
34 'slug' => $this->slugPrefix,
35 'name' => static::getEditorName(),
36 'title' => __('Store Logo', 'fluent-cart'),
37 'description' => __('Display your store logo.', 'fluent-cart'),
38 'placeholder_image' => Vite::getAssetUrl('images/placeholder.svg'),
39 'store_logo' => $renderer->getStoreLogo(),
40 'store_name' => $renderer->getStoreName(),
41 'home_url' => home_url('/')
42 ],
43 'fluent_cart_block_translation' => TransStrings::blockStrings(),
44 ];
45 }
46
47 public function render(array $shortCodeAttribute, $block = null)
48 {
49 $renderer = new StoreLogoRenderer();
50
51 ob_start();
52 $renderer->render($shortCodeAttribute);
53 return ob_get_clean();
54 }
55 }
56