PluginProbe ʕ •ᴥ•ʔ
The Post Grid – Shortcode, Gutenberg Blocks and Elementor Addon for Post Grid / 7.8.8
The Post Grid – Shortcode, Gutenberg Blocks and Elementor Addon for Post Grid v7.8.8
7.9.3 7.9.2 trunk 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.2.0 4.2.1 4.2.2 4.2.3 5.0.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 6.0.0 7.0.0 7.0.1 7.0.2 7.1.0 7.2.0 7.2.1 7.2.10 7.2.11 7.2.2 7.2.3 7.2.4 7.2.5 7.2.6 7.2.7 7.2.8 7.2.9 7.3.0 7.3.1 7.4.0 7.4.1 7.4.2 7.4.3 7.5.0 7.6.0 7.6.1 7.7.0 7.7.1 7.7.10 7.7.11 7.7.12 7.7.13 7.7.14 7.7.15 7.7.16 7.7.17 7.7.18 7.7.19 7.7.2 7.7.20 7.7.21 7.7.22 7.7.3 7.7.4 7.7.5 7.7.6 7.7.7 7.7.8 7.7.9 7.8.0 7.8.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.9.0 7.9.1
the-post-grid / app / Controllers / Admin / Notice / SummerSale.php
the-post-grid / app / Controllers / Admin / Notice Last commit date
BlackFriday.php 8 months ago EidSpecial.php 8 months ago LoadResourceType.php 8 months ago Review.php 8 months ago SummerSale.php 8 months ago
SummerSale.php
90 lines
1 <?php
2 /**
3 * Notice Controller class.
4 *
5 * @package RT_TPG
6 */
7
8 namespace RT\ThePostGrid\Controllers\Admin\Notice;
9
10 // Do not allow directly accessing this file.
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit( 'This script cannot be accessed directly.' );
13 }
14
15 /**
16 * Notice Controller class.
17 */
18 class SummerSale {
19
20 /**
21 * Class Constructor
22 */
23 public function __construct() {
24 add_action( 'admin_notices', [ __CLASS__, 'summer_special_deal_admin_notice' ] );
25 add_action( 'wp_ajax_dismiss_summer_notice', [ __CLASS__, 'dismiss_summer_notice' ] );
26 }
27
28 public static function summer_special_deal_admin_notice() {
29 // Set expiration date (April 7)
30 $expiration_date = strtotime( 'May 31, 2025' );
31
32 // Check if the current date is past the expiration date
33 if ( time() > $expiration_date ) {
34 return;
35 }
36
37 // Check if notice is dismissed
38 if ( get_user_meta( get_current_user_id(), 'dismissed_summer_notice', true ) ) {
39 return;
40 }
41
42
43 $plugin_name = 'The Post Grid';
44 $download_link = 'https://www.radiustheme.com/downloads/the-post-grid-pro-for-wordpress/';
45
46 ?>
47
48
49 <div class="notice notice-info is-dismissible summer-notice" data-rttpg-dismissable="rttpg_dismiss_bf_notice"
50 style="display:grid !important;grid-template-columns: 100px auto;padding-top: 25px; padding-bottom: 22px;">
51 <img alt="<?php echo esc_attr( $plugin_name ); ?>"
52 src="<?php echo esc_url( rtTPG()->get_assets_uri( 'images/post-grid-gif.gif' ) ); ?>"
53 width="74px" height="74px" style="grid-row: 1 / 4; align-self: center;justify-self: center"/>
54 <h3 style="margin:0;display: inline-flex;align-items: center;gap: 4px;">
55 <?php echo sprintf( ' %s – ☀️ Summer Sale', esc_html( $plugin_name ) ); ?>
56 <img alt="Deal" style="width: 60px;position: static" src="<?php echo esc_url( rtTPG()->get_assets_uri( 'images/deal.gif' ) ); ?>">
57 </h3>
58 <p style="margin-top: 0; font-size: 14px;">
59 <strong>Hot Summer Deals:</strong>
60 Beat the heat with cool discounts on
61 <b><a href="<?php echo esc_url( $download_link ); ?>" style="text-decoration: none;color: inherit">The Post Grid</a></b>. Save
62 <b style="display:inline-block;color: white;background:red;padding: 0 8px;border-radius:3px; transform: skewX(-10deg);">UP TO 40%</b>
63 for a limited time! ☀️🔥🌴
64 </p>
65 <p style="margin:0;">
66 <a class="button button-primary" href="<?php echo esc_url( $download_link ); ?>"
67 style="background: #4e13ff;"
68 target="_blank">Buy Now</a>
69 </p>
70 </div>
71
72
73 <script>
74 jQuery(document).on('click', '.summer-notice .notice-dismiss', function () {
75 jQuery.post(ajaxurl, {
76 action: 'dismiss_summer_notice',
77 security: '<?php echo wp_create_nonce( "dismiss_summer_notice" ); ?>',
78 })
79 })
80 </script>
81 <?php
82 }
83
84 public static function dismiss_summer_notice() {
85 check_ajax_referer( 'dismiss_summer_notice', 'security' );
86 update_user_meta( get_current_user_id(), 'dismissed_summer_notice', true );
87 wp_die();
88 }
89
90 }