'20-09-2022', // 'end' => '29-12-2022', // 'type' => 'content', // 'content' => 'PostX - ⚡Flash Sale⚡ is LIVE! Spend 25% LESS on Premium Features for a ⏳LIMITED Time!', // 'force' => false // ), array( 'start' => '09-11-2022', // Date format "d-m-Y" [08-02-2019] 'end' => '03-12-2022', 'type' => 'banner', 'content' => ULTP_URL.'assets/img/banner.jpg', 'force' => true ), ); if (count($default_notice) > 0) { foreach ($default_notice as $key => $notice) { $current_time = date('U'); if ($current_time > strtotime($notice['start']) && $current_time < strtotime($notice['end'])) { $this->type = $notice['type']; $this->content = $notice['content']; $this->force = $notice['force']; add_action('admin_notices', array($this, 'ultp_installation_notice_callback')); } } } add_action('admin_init', array($this, 'set_dismiss_notice_callback')); } /** * Promotional Dismiss Notice Option Data * * @since v.2.0.1 * @param NULL * @return NULL */ public function set_dismiss_notice_callback() { if (!isset($_GET['disable_postx_notice_' . $this->notice_version])) { return ; } if (sanitize_key($_GET['disable_postx_notice_' . $this->notice_version]) == 'yes') { set_transient( 'ultp_get_pro_notice_' . $this->notice_version, 'off', 2592000 ); // 30 days notice } } /** * Dismiss Notice HTML Data * * @since v.1.0.0 * @param NULL * @return STRING */ public function ultp_installation_notice_callback() { if (get_transient('ultp_get_pro_notice_' . $this->notice_version) != 'off') { if (!ultimate_post()->is_lc_active() && ($this->force || get_transient('wpxpo_installation_date') != 'yes')) { if (!isset($_GET['disable_postx_notice_' . $this->notice_version])) { $this->ultp_notice_css(); ?>
type) { case 'banner': ?>
Dismiss Discount Banner
content; ?>