Skip to content

Commit 25e2337

Browse files
committed
Revert changes from delete_user_metadata()
1 parent 5d4ae20 commit 25e2337

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

includes/uninstall-functions.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,13 @@ function delete_options() {
4040
* @internal
4141
*/
4242
function delete_user_metadata() {
43-
global $wpdb;
44-
45-
$keys = [
43+
$keys = [
4644
'amp_dev_tools_enabled',
4745
'amp_review_panel_dismissed_for_template_mode',
4846
];
49-
$where_clause = [];
50-
5147
foreach ( $keys as $key ) {
52-
$where_clause[] = $wpdb->prepare( ' meta_key = %s ', $key );
48+
delete_metadata( 'user', 0, $key, '', true );
5349
}
54-
55-
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Cannot cache result since we're deleting the records.
56-
$wpdb->query(
57-
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
58-
"DELETE FROM $wpdb->usermeta WHERE " . implode( ' OR ', $where_clause )
59-
);
6050
}
6151

6252
/**

0 commit comments

Comments
 (0)