Classes
1 month ago
Controls
3 months ago
Elements
3 weeks ago
Extensions
1 month ago
Template
1 month ago
Traits
3 weeks ago
templates
2 months ago
bfcm-pointer.php
1 month ago
index.php
3 years ago
bfcm-pointer.php
74 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | exit; |
| 4 | } // Exit if accessed directly |
| 5 | |
| 6 | add_action( |
| 7 | 'in_admin_header', |
| 8 | function () { |
| 9 | |
| 10 | if ( $this->pro_enabled || time() > strtotime( '09:59:59pm 4th December, 2025' ) || ( $GLOBALS["pagenow"] !== 'index.php' && get_current_screen()->id !== 'toplevel_page_eael-settings' ) || get_transient( 'eael_bfcm25_pointer_dismiss' ) ) { |
| 11 | return; |
| 12 | } |
| 13 | |
| 14 | wp_enqueue_script( 'jquery' ); |
| 15 | wp_enqueue_style( 'wp-pointer' ); |
| 16 | wp_enqueue_script( 'wp-pointer' ); |
| 17 | |
| 18 | $pointer_pririty = get_option( '_wpdeveloper_plugin_pointer_priority' ); |
| 19 | if ( empty( $pointer_pririty ) || $pointer_pririty > 1 ) { |
| 20 | update_option( '_wpdeveloper_plugin_pointer_priority', 1 ); |
| 21 | $pointer_pririty = 1; |
| 22 | } |
| 23 | |
| 24 | if ( absint( $pointer_pririty ) === 1 ) { |
| 25 | ?> |
| 26 | <script> |
| 27 | jQuery( |
| 28 | function () { |
| 29 | jQuery('#toplevel_page_eael-settings').pointer( |
| 30 | { |
| 31 | content: |
| 32 | "<h3 style='font-weight: 600;'>Essential Addons: Black Friday Sale</h3>" + |
| 33 | "<p style='margin: 1em 0;'>Unlock the full power of Elementor with 110+ advanced elements. Build faster, design smarter.</p>" + |
| 34 | "<p><a class='button button-primary' href='https://essential-addons.com/bfcm-wp-admin-pointer' target='_blank'>Save $120</a></p>", |
| 35 | |
| 36 | position: |
| 37 | { |
| 38 | edge: 'left', |
| 39 | align: 'center' |
| 40 | }, |
| 41 | |
| 42 | pointerClass: |
| 43 | 'wp-pointer', |
| 44 | |
| 45 | close: function () { |
| 46 | jQuery.post( |
| 47 | ajaxurl, |
| 48 | { |
| 49 | pointer: 'eael', |
| 50 | action: 'dismiss-wp-pointer', |
| 51 | } |
| 52 | ); |
| 53 | }, |
| 54 | |
| 55 | } |
| 56 | ).pointer('open'); |
| 57 | } |
| 58 | ); |
| 59 | </script> |
| 60 | <?php |
| 61 | } |
| 62 | } |
| 63 | ); |
| 64 | |
| 65 | add_action( |
| 66 | 'admin_init', |
| 67 | function () { |
| 68 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 69 | if ( isset( $_POST['action'] ) && 'dismiss-wp-pointer' == $_POST['action'] && isset( $_POST['pointer'] ) && 'eael' == $_POST['pointer'] ) { |
| 70 | set_transient( 'eael_bfcm25_pointer_dismiss', true, DAY_IN_SECONDS * 30 ); |
| 71 | delete_option( '_wpdeveloper_plugin_pointer_priority' ); |
| 72 | } |
| 73 | } |
| 74 | ); |