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.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 1.7.9 1.8.1 All 42 releases
sellkit / includes / admin / notices / notice-base.php

notice-base.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster trunk, at includes/admin/notices/notice-base.php

92 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Sellkit\Admin\Notices;
4
5 defined( 'ABSPATH' ) || die();
6
7 /**
8 * Notice base class.
9 *
10 * @since 1.1.0
11 */
12 abstract class Notice_Base {
13 /**
14 * Dismissed notices.
15 *
16 * @since 1.1.0
17 * @var array|bool|mixed
18 */
19 public $dismissed_notices;
20
21 /**
22 * Notice content.
23 *
24 * @since 1.1.0
25 * @var string
26 */
27 public $content;
28
29 /**
30 * Notice buttons.
31 *
32 * @since 1.1.0
33 * @var array
34 */
35 public $buttons;
36
37 /**
38 * Notice key
39 *
40 * @since 1.1.0
41 * @var string
42 */
43 public $key;
44
45 /**
46 * Active theme.
47 *
48 * @since 1.7.4
49 * @var string
50 */
51 public $active_theme;
52
53 /**
54 * Notice_Base constructor.
55 *
56 * @since 1.1.0
57 */
58 public function __construct() {
59 $dismissed_notices = sellkit_get_option( 'dismissed_notices', '' );
60
61 $this->dismissed_notices = empty( $dismissed_notices ) ? [] : $dismissed_notices;
62 $this->active_theme = wp_get_theme()->get( 'Name' );
63 }
64
65 /**
66 * Notice content wrapper.
67 *
68 * @since 1.1.0
69 */
70 public function notice_content_wrapper() {
71 ?>
72 <div class="sellkit-notice notice is-dismissible" data-key="<?php echo esc_attr( $this->key ); ?>">
73 <div class="sellkit-notice-aside"><span class="sellkit-notice-aside-icon"><span></span></span></div>
74 <div class="sellkit-notice-content">
75 <div class="sellkit-notice-content-body">
76 <?php echo esc_sql( $this->content ); ?>
77 </div>
78 <div class="sellkit-notice-content-footer">
79 <?php
80 foreach ( $this->buttons as $url => $text ) {
81 printf( '<a class="button-primary" href="%1s">%2s</a>', esc_url( $url ), esc_js( $text ) );
82 }
83 ?>
84 </div>
85 </div>
86 <button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span>
87 </button>
88 </div>
89 <?php
90 }
91 }
92