diff --git a/admin/class-hfe-addons-actions.php b/admin/class-hfe-addons-actions.php index 2cf780736..36eea9183 100644 --- a/admin/class-hfe-addons-actions.php +++ b/admin/class-hfe-addons-actions.php @@ -71,6 +71,8 @@ public function __construct() { add_action( 'wp_ajax_hfe_flush_permalink_notice', [ $this, 'hfe_flush_permalink_notice' ] ); add_action( 'wp_ajax_nopriv_hfe_flush_permalink_notice', [ $this, 'hfe_flush_permalink_notice' ] ); + add_action( 'wp_ajax_dismiss_sticky_header_notice', [ $this, 'dismiss_sticky_header_notice' ] ); + } /** @@ -572,6 +574,24 @@ public function save_analytics_option() { } } + /** + * Handle sticky header notice dismissal + * + * @return void + */ + public function dismiss_sticky_header_notice() { + if (!wp_verify_nonce($_POST['nonce'], 'hfe_dismiss_sticky_header_notice')) { + wp_die('Security check failed'); + } + + if ( ! current_user_can( 'manage_options' ) ) { + wp_send_json_error( 'Unauthorized', 403 ); + } + + update_user_meta(get_current_user_id(), 'uae_sticky_header_notice_dismissed', true); + wp_send_json_success(); + } + } /** diff --git a/inc/class-header-footer-elementor.php b/inc/class-header-footer-elementor.php index 1ff6c64f7..3d589c557 100644 --- a/inc/class-header-footer-elementor.php +++ b/inc/class-header-footer-elementor.php @@ -92,6 +92,11 @@ function () { 'in_admin_header', function () { $this->render_admin_top_bar(); + $current_screen = get_current_screen(); + if( 'edit-elementor-hf' === $current_screen->id ){ + // Add sticky header promotion notice for elementor-hf listing page + $this->sticky_header_promotion_notice(); + } } ); } @@ -368,6 +373,144 @@ public function elementor_outdated() { printf( '
%2$s
%3$s