PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / trunk
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster vtrunk
2.8.0 2.7.0 2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 All 44 releases
sellkit / includes / block-editor / blocks / smart-coupon / inner-blocks / smart-coupon-code / class.php

class.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster trunk, at includes/block-editor/blocks/smart-coupon/inner-blocks/smart-coupon-code/class.php

67 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Sellkit\Blocks\Inner_Block;
3
4 defined( 'ABSPATH' ) || exit;
5
6 use Sellkit\Blocks\Sellkit_Blocks;
7
8 /**
9 * Smart Coupon Code class.
10 *
11 * @since 2.3.0
12 * @package Sellkit\Blocks\Inner_Block
13 */
14 class Smart_Coupon_Code {
15 /**
16 * Smart_Coupon_Code constructor.
17 *
18 * @since 2.3.0
19 */
20 public function __construct() {
21 if ( ! is_admin() ) {
22 add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
23 }
24 }
25
26 /**
27 * Enqueue smart coupon code script.
28 *
29 * @since 2.3.0
30 */
31 public function enqueue_scripts() {
32 wp_enqueue_script(
33 'sellkit-block-smart-coupon-code-script',
34 sellkit()->plugin_url() . 'assets/dist/blocks/smart-coupon-code.js',
35 [ 'jquery', 'wp-util' ],
36 sellkit()->version(),
37 true
38 );
39
40 wp_localize_script('sellkit-block-smart-coupon-code-script', 'sellkit_smart_coupon_code', [
41 'nonce' => wp_create_nonce( 'sellkit_smart_coupon_code' )
42 ] );
43 }
44
45 /**
46 * Register block meta.
47 *
48 * @since 2.3.0
49 */
50 public function register_block_meta() {
51 register_block_type_from_metadata(
52 __DIR__
53 );
54 }
55
56 /**
57 * Render smart coupon code.
58 *
59 * @param string $content Block content.
60 * @since 2.3.0
61 * @return string
62 */
63 public function smart_coupon_code( $content ) {
64 return $content;
65 }
66 }
67