controls
6 months ago
helpers
6 months ago
pa-display-conditions
6 months ago
templates
6 months ago
acf-helper.php
6 months ago
addons-cross-cp.php
6 months ago
addons-integration.php
6 months ago
assets-manager.php
6 months ago
class-pa-core.php
6 months ago
cm-pointer.php
6 months ago
helper-functions.php
6 months ago
live-editor-modal.php
6 months ago
module-base.php
6 months ago
pa-nav-menu-walker.php
6 months ago
papro-promotion.php
6 months ago
premium-template-tags.php
6 months ago
cm-pointer.php
78 lines
| 1 | <?php |
| 2 | |
| 3 | use PremiumAddons\Includes\Helper_Functions; |
| 4 | |
| 5 | if ( ! defined( 'ABSPATH' ) ) { |
| 6 | exit; |
| 7 | } // Exit if accessed directly |
| 8 | |
| 9 | add_action( |
| 10 | 'in_admin_header', |
| 11 | function () { |
| 12 | |
| 13 | if ( Helper_Functions::check_papro_version() || time() > strtotime( '09:59:59pm 8th December, 2025' ) || ( $GLOBALS["pagenow"] !== 'index.php' && get_current_screen()->id !== 'toplevel_page_premium-addons' ) || get_transient( 'pa_cm25_pointer_dismiss' ) ) { |
| 14 | return; |
| 15 | } |
| 16 | |
| 17 | wp_enqueue_script( 'jquery' ); |
| 18 | wp_enqueue_style( 'wp-pointer' ); |
| 19 | wp_enqueue_script( 'wp-pointer' ); |
| 20 | |
| 21 | $pointer_priority = get_option( '_pa_plugin_pointer_priority' ); |
| 22 | |
| 23 | if ( empty( $pointer_priority ) || $pointer_priority > 1 ) { |
| 24 | update_option( '_pa_plugin_pointer_priority', 1 ); |
| 25 | $pointer_priority = 1; |
| 26 | } |
| 27 | |
| 28 | if ( absint( $pointer_priority ) === 1 ) { |
| 29 | ?> |
| 30 | <script> |
| 31 | jQuery( |
| 32 | function () { |
| 33 | jQuery('#toplevel_page_premium-addons').pointer( |
| 34 | { |
| 35 | content: |
| 36 | "<h3 style='font-weight: 600;'>Premium Addons: Cyber Monday</h3>" + |
| 37 | "<p style='margin: 1em 0;'>Unlock the full power of Elementor with 90+ advanced elements and 580+ templates. Build smarter and faster.</p>" + |
| 38 | "<p><a class='button button-primary' href='https://premiumaddons.com/black-friday/#bfdeals' target='_blank'>Save $105 Now</a></p>", |
| 39 | |
| 40 | position: |
| 41 | { |
| 42 | edge: 'left', |
| 43 | align: 'center' |
| 44 | }, |
| 45 | |
| 46 | pointerClass: |
| 47 | 'wp-pointer', |
| 48 | |
| 49 | close: function () { |
| 50 | jQuery.post( |
| 51 | ajaxurl, |
| 52 | { |
| 53 | pointer: 'pa', |
| 54 | action: 'dismiss-wp-pointer', |
| 55 | } |
| 56 | ); |
| 57 | }, |
| 58 | |
| 59 | } |
| 60 | ).pointer('open'); |
| 61 | } |
| 62 | ); |
| 63 | </script> |
| 64 | <?php |
| 65 | } |
| 66 | } |
| 67 | ); |
| 68 | |
| 69 | add_action( |
| 70 | 'admin_init', |
| 71 | function () { |
| 72 | if ( isset( $_POST['action'] ) && 'dismiss-wp-pointer' == $_POST['action'] && isset( $_POST['pointer'] ) && 'pa' == $_POST['pointer'] ) { |
| 73 | set_transient( 'pa_cm25_pointer_dismiss', true, DAY_IN_SECONDS * 30 ); |
| 74 | delete_option( '_pa_plugin_pointer_priority' ); |
| 75 | } |
| 76 | } |
| 77 | ); |
| 78 |