PluginProbe
Post Grid Gutenberg Blocks – PostX / 2.6.2
Post Grid Gutenberg Blocks – PostX v2.6.2
5.0.39 5.0.38 5.0.37 5.0.36 5.0.35 5.0.34 5.0.33 5.0.32 5.0.31 5.0.30 5.0.29 5.0.28 5.0.27 5.0.26 5.0.25 5.0.23 5.0.24 5.0.22 5.0.21 5.0.20 5.0.19 5.0.18 5.0.17 2.1.1 2.1.2 All 237 releases
ultimate-post / classes / Notice.php

Notice.php in Post Grid Gutenberg Blocks – PostX 2.6.2, at classes/Notice.php

188 lines 6.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Notice Action.
4 *
5 * @package ULTP\Notice
6 * @since v.1.0.0
7 */
8 namespace ULTP;
9
10 defined('ABSPATH') || exit;
11
12 /**
13 * Notice class.
14 */
15 class Notice {
16 /**
17 * Setup class.
18 *
19 * @since v.1.0.0
20 */
21 public function __construct(){
22 // add_action('admin_notices', array($this, 'ultp_installation_notice_callback'));
23 add_action('admin_init', array($this, 'set_dismiss_notice_callback'));
24 }
25
26 /**
27 * Promotional Dismiss Notice Option Data
28 *
29 * @since v.2.0.1
30 * @param NULL
31 * @return NULL
32 */
33 public function set_dismiss_notice_callback() {
34 if (!isset($_GET['disable_postx_notice_v1'])) {
35 return ;
36 }
37 if (sanitize_key($_GET['disable_postx_notice_v1']) == 'yes') {
38 // set_transient( 'ultp_get_pro_notice_v6', 'off', 2592000 ); // 30 days notice
39 }
40 }
41
42 /**
43 * Dismiss Notice HTML Data
44 *
45 * @since v.1.0.0
46 * @param NULL
47 * @return STRING
48 */
49 public function ultp_installation_notice_callback() {
50 if (get_transient('ultp_get_pro_notice_v6') != 'off') {
51 if (!ultimate_post()->is_lc_active()) {
52 if (!isset($_GET['disable_postx_notice_v1'])) {
53 $this->ultp_notice_css();
54 ?>
55 <div class="wc-install ultp-pro-notice">
56 <!-- <div class="wc-install-body ultp-image-banner">
57 <a class="wc-dismiss-notice" href="<?php //echo esc_url( add_query_arg( 'disable_postx_notice_v1', 'yes' ) ); ?>"><span class="dashicons dashicons-dismiss"></span></a>
58 <a class="ultp-btn-image" target="_blank" href="<?php //echo esc_url(ultimate_post()->get_premium_link()); ?>">
59 <img loading="lazy" src="<?php //echo esc_url(ULTP_URL.'assets/img/banner.jpg'); ?>" alt="up to 40% Off" />
60 </a>
61 </div> -->
62 <!-- <div class="wc-install-body">
63 <div><?php //wp_kses(__('<strong>PostX - ⚡Flash Sale⚡</strong> is LIVE! Spend <strong style="color:#1cb53e;">25% LESS</strong> on Premium Features for a <strong>⏳LIMITED Time!</strong>', 'ultimate-post'), 'post'); ?></div>
64 <a class="button button-primary button-hero ultp-btn-notice-pro" target="_blank" href="<?php //echo esc_url(ultimate_post()->get_premium_link()); ?>"><span class="dashicons dashicons-image-rotate"></span><?php //_e('Get Now', 'ultimate-post'); ?></a>
65 <a class="button-secondary button-large" href="<?php //echo esc_url( add_query_arg( 'disable_postx_notice_v1', 'yes' ) ); ?>"><?php //_e('No Thanks!', 'ultimate-post'); ?></a>
66 </div> -->
67 <div class="wc-install-body">
68 <div><?php wp_kses(__("Be a part of <strong>PostX's</strong> 🍉 <strong style='color:#1cb53e;'>Summer Sale</strong> Celebration by Getting Up to 🔥 <strong>30% DISCOUNT</strong> on PostX! ", 'ultimate-post'), 'post'); ?></div>
69 <!-- <div><?php //wp_kses(__('Thanks for using the free version of <strong>PostX Gutenberg Blocks</strong>. We have a special <strong>20% discount</strong> for a limited time. Use this coupon:', 'ultimate-post'), 'post'); ?><strong><code>POSTXAD20</code></strong></div> -->
70 <a class="button button-primary button-hero ultp-btn-notice-pro" target="_blank" href="<?php echo esc_url(ultimate_post()->get_premium_link()); ?>"><span class="dashicons dashicons-image-rotate"></span><?php esc_html_e('Upgrading to Pro', 'ultimate-post'); ?></a>
71 <a class="button-secondary button-large" href="<?php echo esc_url( add_query_arg( 'disable_postx_notice_v1', 'yes' ) ); ?>"><?php esc_html_e('No Thanks / Close.', 'ultimate-post'); ?></a>
72 </div>
73 </div>
74 <?php
75 }
76 }
77 }
78 }
79
80 /**
81 * Admin Notice CSS File
82 *
83 * @since v.1.0.0
84 * @param NULL
85 * @return STRING
86 */
87 public function ultp_notice_css() {
88 ?>
89 <style type="text/css">
90 .wc-install {
91 display: flex;
92 align-items: center;
93 background: #fff;
94 margin-top: 40px;
95 width: calc(100% - 50px);
96 border: 1px solid #ccd0d4;
97 padding: 12px 15px;
98 border-radius: 4px;
99 border-left: 3px solid #2271b1;
100 }
101 .wc-install img {
102 margin-right: 0;
103 max-width: 100%;
104 }
105 .wc-install-body {
106 -ms-flex: 1;
107 flex: 1;
108 position: relative;
109 }
110 .wc-install-body h3 {
111 margin-top: 0;
112 font-size: 24px;
113 margin-bottom: 15px;
114 }
115 .ultp-install-btn {
116 margin-top: 15px;
117 display: inline-block;
118 }
119 .wc-install .dashicons{
120 display: none;
121 animation: dashicons-spin 1s infinite;
122 animation-timing-function: linear;
123 }
124 .wc-install.loading .dashicons {
125 display: inline-block;
126 margin-top: 12px;
127 margin-right: 5px;
128 }
129 .ultp-pro-notice .wc-install-body h3 {
130 font-size: 20px;
131 margin-bottom: 5px;
132 }
133 .ultp-pro-notice .wc-install-body > div {
134 max-width: 100%;
135 margin-bottom: 10px;
136 }
137 .ultp-pro-notice .button-hero {
138 padding: 8px 14px !important;
139 min-height: inherit !important;
140 line-height: 1 !important;
141 box-shadow: none;
142 border: none;
143 transition: 400ms;
144 }
145 .ultp-pro-notice .ultp-btn-notice-pro {
146 background: #2271b1;
147 color: #fff;
148 }
149 .ultp-pro-notice .ultp-btn-notice-pro:hover,
150 .ultp-pro-notice .ultp-btn-notice-pro:focus {
151 background: #185a8f;
152 }
153 .ultp-pro-notice .button-hero:hover,
154 .ultp-pro-notice .button-hero:focus {
155 border: none;
156 box-shadow: none;
157 }
158 @keyframes dashicons-spin {
159 0% {
160 transform: rotate( 0deg );
161 }
162 100% {
163 transform: rotate( 360deg );
164 }
165 }
166 .wc-dismiss-notice {
167 position: absolute;
168 text-decoration: none;
169 float: right;
170 right: 0px;
171 color: #787c82;
172 transition: 400ms;
173 top: 0px
174 }
175 .wc-dismiss-notice:hover {
176 color:red;
177 }
178 .wc-dismiss-notice .dashicons{
179 display: inline-block;
180 text-decoration: none;
181 animation: none;
182 font-size: 16px;
183 }
184 </style>
185 <?php
186 }
187
188 }