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
21 changes: 5 additions & 16 deletions inc/admin/class-flash-theme-review-notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,29 +182,18 @@ 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( 'flash_theme_installed_time' );

// Delete options data.
if ( $theme_installed_time ) {
delete_option( 'flash_theme_installed_time' );
}

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

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

// Delete partial notice remove data.
if ( $ignored_notice_partially ) {
delete_user_meta( $user->ID, 'nag_flash_ignore_theme_review_notice_partially' );
}
}
// Delete user meta data for theme review notice, for every user in
// one query per key - avoids loading every user on the site just to
// unconditionally delete a key that either exists or doesn't.
delete_metadata( 'user', 0, 'flash_ignore_theme_review_notice', '', true );
delete_metadata( 'user', 0, 'nag_flash_ignore_theme_review_notice_partially', '', true );
}
}

Expand Down
Loading