get_notice_data('banner', $this->notice_version); $this->valid_notices = array(); if (is_array($default_notice ) && 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']) && $notice['visibility']) { $this->valid_notices[] = $notice; } } } if (count($this->valid_notices) > 0) { 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(count($this->valid_notices)>0) { foreach ($this->valid_notices as $notice) { $notice_key = isset($notice['key'])?$notice['key']:$this->notice_version; if (isset($_GET['disable_postx_notice_' .$notice_key ])) { if (sanitize_key($_GET['disable_postx_notice_' . $notice_key]) == 'yes') { // set_transient( 'ultp_get_pro_notice_' . $this->notice_version, 'off', 2592000 ); // 30 days notice if(isset($notice['repeat_interval']) && ''!=$notice['repeat_interval']) { $interval = (int) $notice['repeat_interval']; ultimate_post()->set_transient_without_cache('ultp_get_pro_notice_' . $notice_key, 'off', $interval ); // 30 (2592000) days notice } else { ultimate_post()->set_transient_without_cache('ultp_get_pro_notice_' . $notice_key, 'off' ); // 30 (2592000) days notice } } } } } } /** * Dismiss Notice HTML Data * * @since v.1.0.0 * @param NULL * @return STRING */ public function ultp_installation_notice_callback() { // ultimate_post()->get_tran('ultp_get_pro_notice_' . $this->notice_version) != 'off' if(count($this->valid_notices)>0) { foreach ($this->valid_notices as $notice) { $notice_key = isset($notice['key'])?$notice['key']:$this->notice_version; if (ultimate_post()->get_transient_without_cache('ultp_get_pro_notice_' . $notice_key) != 'off') { // if (!ultimate_post()->is_lc_active() && ($this->force || get_transient('wpxpo_installation_date') != 'yes')) { if ( ($notice['force'] || get_transient('wpxpo_installation_date') != 'yes') ) { if (!isset($_GET['disable_postx_notice_' . $notice_key])) { $this->ultp_notice_css(); ?>
Dismiss Discount Banner