Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: delete_user

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
270           // Clean links
271           $wpdb->query("DELETE FROM $wpdb->links WHERE link_owner = $id");
272      } else {
273           $reassign = (int) $reassign;
274           $wpdb->query("UPDATE $wpdb->posts SET post_author = {$reassign} WHERE post_author = {$id}");
275           $wpdb->query("UPDATE $wpdb->links SET link_owner = {$reassign} WHERE link_owner = {$id}");
276      }
277
278      // FINALLY, delete user
279      do_action('delete_user', $id);
280
281      $wpdb->query("DELETE FROM $wpdb->users WHERE ID = $id");
282      $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = '$id'");
283
284      wp_cache_delete($id, 'users');
285      wp_cache_delete($user->user_login, 'userlogins');
286
287      return true;
288 }