PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 3.2.13
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v3.2.13
3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 All 156 releases
notificationx / includes / Types / OfferAnnouncement.php

OfferAnnouncement.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar 3.2.13, at includes/Types/OfferAnnouncement.php

101 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Extension Abstract
5 *
6 * @package NotificationX\Extensions
7 */
8
9 namespace NotificationX\Types;
10
11 use NotificationX\Extensions\GlobalFields;
12 use NotificationX\GetInstance;
13 use NotificationX\Modules;
14 use NotificationX\NotificationX;
15
16 /**
17 * Extension Abstract for all Extension.
18 * @method static OfferAnnouncement get_instance($args = null)
19 */
20 class OfferAnnouncement extends Types {
21 /**
22 * Instance of OfferAnnouncement
23 *
24 * @var OfferAnnouncement
25 */
26 use GetInstance;
27 public $priority = 36;
28 public $module = ['modules_announcements'];
29 public $id = 'offer_announcement';
30 public $default_source = 'announcements';
31 public $default_theme = 'announcements_theme-one';
32 public $is_pro = true;
33 // public $link_type = 'comment_url';
34
35 /**
36 * Initially Invoked when initialized.
37 */
38 public function __construct() {
39 parent::__construct();
40
41 // add_filter('nx_link_types', [$this, 'link_types']);
42 }
43
44 public function init()
45 {
46 parent::init();
47 $this->title = __('Discount Alert', 'notificationx');
48 $this->popup = [
49 "denyButtonText" => __("<a href='https://notificationx.com/docs/configure-discount-alert/' target='_blank'>More Info</a>", "notificationx"),
50 "confirmButtonText" => __("<a href='https://notificationx.com/#pricing' target='_blank'>Upgrade to PRO</a>", "notificationx"),
51 // phpcs:disable PluginCheck.CodeAnalysis.Offloading.OffloadedContent -- False positive for this context: these are HTML email bodies and remote documentation/tutorial links in admin help text, not offloaded plugin assets. Audited 2026-07-16.
52 "html"=> __('
53 <span>Discount Alert by NotificationX will allow you to display offers/discounts of your products/services on your website interactively & easily.</span>
54 <video id="pro_alert_video_popup" type="text/html" allowfullscreen width="450" height="235" autoplay loop muted>
55 <source src="https://notificationx.com/wp-content/uploads/2024/01/NX-Discount-Alert-1.mp4" type="video/mp4">
56 </video>
57 ', 'notificationx')
58 // phpcs:enable PluginCheck.CodeAnalysis.Offloading.OffloadedContent
59 ];
60 }
61
62 /**
63 * Hooked to nx_before_metabox_load action.
64 *
65 * @return void
66 */
67 public function init_fields() {
68 parent::init_fields();
69 // add_filter('nx_content_trim_length_dependency', [$this, 'content_trim_length_dependency']);
70
71 }
72
73 /**
74 * Adds option to Link Type field in Content tab.
75 *
76 * @param array $options
77 * @return array
78 */
79 public function link_types($options){
80 $_options = GlobalFields::get_instance()->normalize_fields([
81 'comment_url' => __('Comment URL', 'notificationx'),
82 ], 'type', $this->id);
83
84 return array_merge($options, $_options);
85 }
86
87
88 /**
89 * This method is an implementable method for All Extension coming forward.
90 *
91 * @param array $args Settings arguments.
92 * @return mixed
93 */
94 public function content_trim_length_dependency($dependency) {
95 $dependency[] = 'comments_theme-six-free';
96 $dependency[] = 'comments_theme-seven-free';
97 $dependency[] = 'comments_theme-eight-free';
98 return $dependency;
99 }
100 }
101