Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions inc/admin/class-accelerate-theme-review-notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ public function ignore_theme_review_notice_partially() {
* Remove the data set after the theme has been switched to other theme.
*/
public function review_notice_data_remove() {
$get_all_users = get_users();
$theme_installed_time = get_option( 'accelerate_theme_installed_time' );

// Delete options data.
Expand All @@ -189,18 +188,18 @@ public function review_notice_data_remove() {
}

// Delete user meta data for theme review notice.
foreach ( $get_all_users as $user ) {
$ignored_notice = get_user_meta( $user->ID, 'accelerate_ignore_theme_review_notice', true );
$ignored_notice_partially = get_user_meta( $user->ID, 'nag_accelerate_ignore_theme_review_notice_partially', true );

// Delete permanent notice remove data.
if ( $ignored_notice ) {
delete_user_meta( $user->ID, 'accelerate_ignore_theme_review_notice' );
}

// Delete partial notice remove data.
if ( $ignored_notice_partially ) {
delete_user_meta( $user->ID, 'nag_accelerate_ignore_theme_review_notice_partially' );
$meta_keys = array( 'accelerate_ignore_theme_review_notice', 'nag_accelerate_ignore_theme_review_notice_partially' );

foreach ( $meta_keys as $meta_key ) {
$user_ids = get_users(
array(
'meta_key' => $meta_key, // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key -- Indexed lookup, runs once on theme switch.
'fields' => 'ID',
)
);

foreach ( $user_ids as $user_id ) {
delete_user_meta( $user_id, $meta_key );
}
}
}
Expand Down
Loading