PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.2.20
Adminify – White Label, Admin Menu Editor, Login Customizer v4.2.20
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / Inc / Classes / Notifications / Discount.php

Discount.php in Adminify – White Label, Admin Menu Editor, Login Customizer 4.2.20, at Inc/Classes/Notifications/Discount.php

101 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace PXLBSAdminify\Inc\Classes\Notifications;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 use PXLBSAdminify\Inc\Classes\Notifications\Base\User_Data;
10 use PXLBSAdminify\Inc\Classes\Notifications\Model\Notice;
11
12
13 if (!class_exists('Discount')) {
14 /**
15 * Discount Class
16 *
17 * Jewel Theme <support@jeweltheme.com>
18 */
19 class Discount extends Notice
20 {
21
22 use User_Data;
23
24 public $color = 'none';
25 public $coupon_code = 'LITEFLASH25';
26
27 /**
28 * Construct method
29 *
30 * @author Jewel Theme <support@jeweltheme.com>
31 */
32 public function __construct()
33 {
34 parent::__construct();
35
36 if (empty(get_option('pxlbsadminify_notice_discount_code'))) {
37 update_option('pxlbsadminify_notice_discount_code', $this->coupon_code);
38 }
39 add_action('admin_enqueue_scripts', [$this, 'discount_coupon_scripts'], 999);
40 }
41
42 /**
43 * Notice Content
44 *
45 * @author Jewel Theme <support@jeweltheme.com>
46 */
47 public function notice_content()
48 { ?>
49 <div class="wp-adminify-discount-coupons-wrapper notice notice-jltma is-dismissible notice-plugin-discount notice-<?php echo esc_attr($this->color); ?> wp-adminify-notice-<?php echo esc_attr($this->get_id()); ?>">
50
51 <div class="wp-adminify-subscribe-content">
52 <h2>
53 Notice Content, Coupon Code: <?php echo esc_attr($this->coupon_code); ?>
54 </h2>
55 <h2>
56 <svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
57 <path d="M5.5 1L0.5 7H5L4.5 11L9.5 5H5L5.5 1Z" stroke="#D92D20" stroke-linecap="round" stroke-linejoin="round" />
58 </svg>
59 Flash Sale
60 </h2>
61 <h3>Notice Content Notice Content Notice Content Notice Content Notice Content Notice Content Notice Content Notice Content </h3>
62 <img width="70" height="70" src="<?php echo esc_url(PXLBSADMINIFY_ASSETS_IMAGE . 'promo-image.png'); ?>" alt="<?php esc_attr_e('20% Discount Coupon', 'adminify'); ?>">
63 </div>
64 </div>
65 <?php
66 }
67
68
69 public function discount_coupon_scripts()
70 {
71 $discount_css = '';
72 $discount_css .= '.wp-adminify-discount-coupons-wrapper.notice-jltma{
73 adding: 0 !important;
74 border: 0;
75 }';
76 $discount_css .= '.wp-adminify-admin #wpbody-content .notice-jltma{
77 adding: 0 !important;
78 border: 0;
79 background-image: url("")
80 }';
81 // $discount_css .= '.wp-adminify-discount-coupons-wrapper .wp-adminify-subscribe-content{
82 // background: red;
83 // }';
84
85 wp_add_inline_style('master-addons-admin-sdk', $discount_css);
86 }
87
88
89
90 /**
91 * Intervals
92 *
93 * @author Jewel Theme <support@jeweltheme.com>
94 */
95 public function intervals()
96 {
97 return array(5, 4, 10, 20, 15, 25, 30, 45, 15, 30, 10, 6);
98 }
99 }
100 }
101