occasion = $occasion; $this->btn_link = $btn_link; $this->start_date = strtotime($start_date); $this->end_date = strtotime($end_date); if ( !defined('WPFNL_PRO_VERSION') && 'yes' === get_option( '_is_wpfnl_black_friday_promotion', 'yes' )) { // Hook into the admin_notices action to display the banner add_action('admin_notices', [$this, 'display_banner']); // Add styles add_action('admin_head', array($this, 'add_styles')); } } /** * Displays the special occasion banner if the current date and time are within the specified range. */ public function display_banner() { $screen = get_current_screen(); $promotional_notice_pages = ['dashboard', 'plugins', 'toplevel_page_wp_funnels', 'wp-funnels_page_wpfnl_settings']; $current_date_time = current_time('timestamp'); if (!in_array($screen->id, $promotional_notice_pages)) { return; } if ( $current_date_time < $this->start_date || $current_date_time > $this->end_date ) { return; } // Calculate the time remaining in seconds $time_remaining = $this->end_date - $current_date_time; ?>