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
255           // Clean links
256           $wpdb->query("DELETE FROM $wpdb->links WHERE link_owner = $id");
257      } else {
258           $reassign = (int) $reassign;
259           $wpdb->query("UPDATE $wpdb->posts SET post_author = {$reassign} WHERE post_author = {$id}");
260           $wpdb->query("UPDATE $wpdb->links SET link_owner = {$reassign} WHERE link_owner = {$id}");
261      }
262
263      // FINALLY, delete user
264      do_action('delete_user', $id);
265
266      $wpdb->query("DELETE FROM $wpdb->users WHERE ID = $id");
267      $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = '$id'");
268
269      wp_cache_delete($id, 'users');
270      wp_cache_delete($user->user_login, 'userlogins');
271
272      return true;
273 }