| @@ -18,11 +18,25 @@ | ||
| 18 | 18 | public function __construct() { |
| 19 | 19 | $this->load_notices(); |
| 20 | 20 | |
| 21 | 21 | add_action( 'wp_ajax_sellkit_admin_notice_dismiss', [ $this, 'dismiss_notice' ] ); |
| 22 | + add_action( 'wp_ajax_sellkit_admin_notice_maybe_later', [ $this, 'handle_maybe_later_rating_btn' ] ); | |
| 22 | 23 | } |
| 23 | 24 | |
| 24 | 25 | /** |
| 26 | + * Handle maybe later button. | |
| 27 | + * | |
| 28 | + * @since 1.5.7 | |
| 29 | + * @return void | |
| 30 | + */ | |
| 31 | + public function handle_maybe_later_rating_btn() { | |
| 32 | + check_ajax_referer( 'sellkit_admin', 'nonce' ); | |
| 33 | + | |
| 34 | + sellkit_update_option( 'sellkit_rating_notice_trigger', time() + 48 * 60 * 60 ); | |
| 35 | + wp_send_json_success( esc_html__( 'The operation was successful.', 'sellkit' ) ); | |
| 36 | + } | |
| 37 | + | |
| 38 | + /** | |
| 25 | 39 | * Load notices. |
| 26 | 40 | * |
| 27 | 41 | * @since 1.1.0 |
| 28 | 42 | * @param string $plugin_name Plugin name. |
| @@ -51,9 +65,9 @@ | ||
| 51 | 65 | $file_name = str_replace( '.php', '', basename( $file_path ) ); |
| 52 | 66 | $operator_class = str_replace( '-', ' ', $file_name ); |
| 53 | 67 | $operator_class = str_replace( ' ', '_', ucwords( $operator_class ) ); |
| 54 | 68 | |
| 55 | - if ( null === $plugin_name && sellkit()->has_pro ) { | |
| 69 | + if ( 'sellkit' === $plugin_name ) { | |
| 56 | 70 | $operator_class = "Sellkit\Admin\Notices\\{$operator_class}"; |
| 57 | 71 | } |
| 58 | 72 | |
| 59 | 73 | if ( 'sellkit-pro' === $plugin_name && sellkit()->has_pro ) { |
| @@ -89,8 +103,12 @@ | ||
| 89 | 103 | $dismissed_notices = empty( $dismissed_notices ) ? [] : $dismissed_notices; |
| 90 | 104 | $new_dismissed_notices = array_merge( $dismissed_notices, [ $new_notice_key ] ); |
| 91 | 105 | |
| 92 | 106 | sellkit_update_option( 'dismissed_notices', array_filter( array_unique( $new_dismissed_notices ) ) ); |
| 107 | + | |
| 108 | + if ( 'sellkit-partners-theme-offer' === $new_notice_key ) { | |
| 109 | + update_option( 'sellkit-partner-offer-theme-dismissed', time() ); | |
| 110 | + } | |
| 93 | 111 | } |
| 94 | 112 | } |
| 95 | 113 | |
| 96 | 114 | new Sellkit_Notices(); |