Skip to content

Commit

Permalink
Store boost banner dismissal in user options
Browse files Browse the repository at this point in the history
  • Loading branch information
thingalon authored and matticbot committed Dec 12, 2022
1 parent 18814f2 commit 6656cb4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wp-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function wpsc_is_boost_active() {
*/
function wpsc_hide_boost_banner() {
check_ajax_referer( 'wpsc_dismiss_boost_banner', 'nonce' );
update_option( 'wpsc_2022_boost_banner', 0, 'no' );
update_user_option( get_current_user_id(), 'wpsc_dismissed_boost_banner', '1' );

wp_die();
}
Expand All @@ -347,7 +347,8 @@ function wpsc_ajax_activate_boost() {
*/
function wpsc_jetpack_boost_install_banner() {
// Don't show the banner if Boost is installed, or the banner has been dismissed.
if ( wpsc_is_boost_active() || ! get_option( 'wpsc_2022_boost_banner', true ) ) {
$is_dismissed = '1' === get_user_option( 'wpsc_dismissed_boost_banner' );
if ( wpsc_is_boost_active() || $is_dismissed ) {
return;
}

Expand Down

0 comments on commit 6656cb4

Please sign in to comment.