Update wpmu_delete_user() to use wp_delete_user()'s Link Deletion API, ensures that all actions and cleanups are run. See #12298
git-svn-id: https://develop.svn.wordpress.org/trunk@13241 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4011b3d4a8
commit
8be48fe96a
@ -142,7 +142,12 @@ function wpmu_delete_user($id) {
|
||||
}
|
||||
|
||||
// Clean links
|
||||
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->links WHERE link_owner = %d", $id) );
|
||||
$link_ids = $wpdb->get_col( $wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_owner = %d", $id) );
|
||||
|
||||
if ( $link_ids ) {
|
||||
foreach ( $link_ids as $link_id )
|
||||
wp_delete_link($link_id);
|
||||
}
|
||||
|
||||
restore_current_blog();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user