PluginProbe
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 3.11.0
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v3.11.0
4.7.2 4.7.1 4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 All 281 releases
surecart / app / src / BlockLibrary / CartMenuIconMigrationService.php
CartMenuIconMigrationService.php
53 lines 991 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SureCart\BlockLibrary;
4
5 /**
6 * Provide cart menu icon migration functionality.
7 */
8 class CartMenuIconMigrationService {
9 /**
10 * Attributes.
11 *
12 * @var string
13 */
14 public array $attributes = array();
15
16 /**
17 * Block.
18 *
19 * @var string
20 */
21 public ?object $block;
22
23 /**
24 * Block HTML.
25 *
26 * @var string
27 */
28 public string $block_html = '';
29
30 /**
31 * Set the initial variables.
32 *
33 * @param array $attributes Attributes.
34 * @param object $block Block.
35 */
36 public function __construct( $attributes = array(), $block = null ) {
37 $this->attributes = $attributes;
38 $this->block = $block;
39 }
40
41 /**
42 * Render the new cart menu icon block.
43 *
44 * @return string
45 */
46 public function render(): string {
47 $cart_menu_icon_block_attrs = wp_json_encode( $this->attributes, JSON_FORCE_OBJECT );
48 $this->block_html .= '<!-- wp:surecart/cart-menu-icon-button ' . $cart_menu_icon_block_attrs . ' /-->';
49
50 return do_blocks( $this->block_html );
51 }
52 }
53